/    Sign up×
Community /Pin to ProfileBookmark

Please help.. How to limit words in box appear on links…?

Hi guys,

I’m working on a website here : [url]http://www.spacescientific.com[/url]
when mouse pointer go on links in website, an yellow (ajax/java>I’m not sure!) box opening and show intro of article. now I want to limit number of words (for example to 20 words) on this window .
to explain what I mean: [URL=”http://www.spacescientific.com/spacescientific.jpg”]http://www.spacescientific.com/spacescientific.jpg[/URL]
how can I do that. any idea???
Can anyone help me about this pleaseee. this is really really important to me

thank you

[LIST=1]
[/LIST]

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@rtretheweyMar 18.2012 — The text you're asking about is all embedded in the HTML for the page, so you'll have to examine the source code for the page to see where and how that text is created. If you post the relevant code here someone might be able to help you.
Copy linkTweet thisAlerts:
@sashaielauthorMar 18.2012 — hi rtrethewey,

Thanks for reply. I can send all files necessary to check about this.

but which files should I attach here?
Copy linkTweet thisAlerts:
@jedaisoulMar 18.2012 — hi rtrethewey,

Thanks for reply. I can send all files necessary to check about this.

but which files should I attach here?[/QUOTE]

I'm not sure it is being done this way but the standard way of having text appear when you mouse over a link is the TITLE= parameter:

<a href="some_page.html" title="this text appears when mouse is over the link">text</a>

Otherwise there may be an "onmouseover" parameter like:

<a href="some_page.html" onmouseover="some_function()">text</a>

Then there would be a javascript function called "some_function" (or some such) in the HTML header.
Copy linkTweet thisAlerts:
@sashaielauthorMar 19.2012 — Hi jedaisoul, thanks for reply.

I think I found the file which can help about this. but I'm not familiar with php coding. can you please take a look and tell me how can I put a word limitation (for example 20 words) in part with Red color in code below:



<?php

/*

# ------------------------------------------------------------------------


# Ja NewsPro


# ------------------------------------------------------------------------


# ------------------------------------------------------------------------


*/

$cls_sufix = trim($params->get('blog_theme',''));

if($cls_sufix) $cls_sufix = '-'.$cls_sufix;

$class = '';

if(JRequest::getInt('subcat', 0)) $class = 'subcontents-'.JRequest::getInt('subcat');

$showcreator = $helper->get( 'showcreator', 0 );

$showdate = $helper->get( 'showdate', 0 );

$maxchars = intval (trim( $helper->get( 'maxchars', 200 ) ));

$showreadmore = intval (trim( $helper->get( 'showreadmore', 1 ) ));

$showsubcattitle = trim( $helper->get( 'showsubcattitle', 1));

$params_new = new JParameter('');

$catid = $secid;

$cooki_name = 'mod'.$moduleid.'_'.$catid;

if(isset($_
COOKIE[$cooki_name]) && $_COOKIE[$cooki_name]!=''){

$cookie_user_setting = $_
COOKIE[$cooki_name];

$arr_values = explode('&', $cookie_user_setting);

if($arr_values){

foreach ($arr_values as $row){

list($k, $value) = explode('=', $row);

if($k!=''){

$params_new->set($k, $value);

}

}

}

}

$introitems = intval (trim( $params_new->get( 'introitems', $helper->get( 'introitems', 1 ) )));

$linkitems = intval (trim( $params_new->get( 'linkitems', $helper->get( 'linkitems', 0 ) ) ));

$showimage = intval (trim( $params_new->get( 'showimage', $helper->get( 'showimage', 1 ) ) ));

$showtooltip = intval (trim( $helper->get( 'showtooltip', 1 ) ));

?>

<div class="ja-box column ja-zintheme<?php echo $cls_sufix;?><?php if (isset($y) && $y==0) echo ' ja-box-first' ?> <?php echo $class?>" style="clear: both;">

<div class="ja-box-inner clearfix">

<?php

foreach ($rows as $i=>$row){

if($i>=$introitems) break;

?>

<div class="ja-zincontent clearfix">

<?php if($showimage) echo $row->image; ?>

<h4 class="ja-zintitle">
<a href="<?php echo $row->link;?>" title="<?php echo strip_tags($row->title);?>"><?php echo $row->title;?></a>
</h4>

<?php if ( $showcreator || $showdate ) : ?>
<p class="ja-zinmeta">
<?php if ($showdate) : ?>
<span class="createdate">
<?php echo $row->created?>
<?php if ($showcreator) : ?> &nbsp;|&nbsp; <?php endif; ?>
</span>
<?php endif; ?>
<?php if ($showcreator) : ?>
<span class="createby"><?php echo $row->creator;?></span>
<?php endif; ?>
</p>
<?php endif; ?>


<?php
if($maxchars > strlen($row->introtext1)) {
echo $row->introtext;
} else {
echo $row->introtext1;
}
?>
<?php if ($showreadmore) : ?>
<p class="readmore">
<a href="<?php echo $row->link; ?>" title="<?php echo JText::sprintf('READ MORE...');?>">
<span><?php echo JText::sprintf('READ MORE...');?></span>
</a>
</p>
<?php endif; ?>
</div>
<?php unset($rows[$i])?>
<?php }?>

<?php if($rows){?>
<div class="ja-zinlinks clearfix">
<strong><?php echo JTEXT::_('MORE:')?></strong>
<ul class="jazin-links">
<?php foreach ($rows as $row){?>
<li>
[COLOR="Red"]<span <?php if($showtooltip){?>class="editlinktip jahasTip" title="<?php echo trim(strip_tags($row->title), '"'); ?>::<?php echo htmlspecialchars($row->image.$row->introtext)?>"<?php }?>>[/COLOR]
<a href="<?php echo $row->link; ?>">
<?php echo $row->title; ?>
</a>
</span>
</li>
<?php }?>
</ul>
</div>
<?php }?>

</div>

</div>


[/QUOTE]
Copy linkTweet thisAlerts:
@jedaisoulMar 19.2012 — I'm not sure how to limit the word count, but I think you can limit the character count to,say, 50 chars. To do that I suspect you need to amend in the bit you highlighted from:

title="<?php echo trim(strip_tags($row->title), '"'); ?>

to:

title="<?php echo substr(trim(strip_tags($row->title), '"'),0,50); ?>

Let me know if that helps...
Copy linkTweet thisAlerts:
@auntniniMar 19.2012 — Might Eric Meyer's explanation about how hover/span works at http://meyerweb.com/eric/css/edge/popups/demo.html be an alternative way to display text, etc.

See http://www.chanit.com/gallery/floral.htm for hover/span used to display images.
Copy linkTweet thisAlerts:
@sashaielauthorMar 20.2012 — ok guys. thanks I found the solution.
×

Success!

Help @sashaiel spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...