Solved

page using jquery.shorten.js is refreshing

Posted on 2014-09-25
7
134 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

744 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

14 Experts available now in Live!

Get 1:1 Help Now