Solved

page using jquery.shorten.js is refreshing

Posted on 2014-09-25
7
140 Views
Last Modified: 2014-09-27
I have a html page showing multi rows of data using jquery.shorten.js.
In firefox it shows the uncompressed rows initially and then it shows the compressed version (kind of looks like refreshing the page)

    <script type="text/javascript" src="images/crm/jquery.shorten.js"></script>
    <script type="text/javascript"> $(document).ready(function(){ $(".comment-
    small").shorten({showChars: 100});});</script>

The 100 rows show up like as below

    <div class="comment-small">My data in row1 ............................. </div>
    <div class="comment-small">My data in row2 ............................. </div>

How can we avoid this refresh please?
0
Comment
Question by:G J
  • 4
  • 3
7 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40345287
add this CSS :
<style>
.comment-small {
    display:none;
}
</style>

Open in new window


and unhide after :
$(".comment-small").shorten({
    moreText: 'read more'
});
$(".comment-small").show(); // here we unhide

Open in new window

0
 

Author Comment

by:G J
ID: 40346047
It still does the refresh though.
Only difference is, earlier it used to show the uncompressed text and then  refreshed and showed the compressed text with "read more" at the end.
Now it shows nothing first and then refreshes and shows the compressed text with "read more" at the end.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40346054
could you provide a link to see that in live?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:G J
ID: 40346134
My stuff is inside the firewall. I think I see where the problem could be though.
The page (http://example.com/page2) if run directly does not refresh.

But the page is currently called from a tab2(gave the code below)  THEN it refreshes.
Do you know why please?


<div id="tab1">
  <ul>
    <li><a href="http://example.com/page1">Tab1</a></li>
    <li><a href="http://example.com/page2">Tab2</a></li>
  </ul>
</div>
<script>$("#tab1").tabs({active:1});</script>
0
 

Author Comment

by:G J
ID: 40346188
The above uses ui tabs from jquery-ui.js .
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40346211
sorry wrong post
0
 

Author Comment

by:G J
ID: 40346266
That's ok. I looked at your post and was wondering.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now