Solved

page using jquery.shorten.js is refreshing

Posted on 2014-09-25
7
150 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

679 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