Solved

page using jquery.shorten.js is refreshing

Posted on 2014-09-25
7
147 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tiny glitch in my main slider 3 39
Make options hidden and show just option that is on 1 29
Jquery Validation Messages Not Showing Up 3 20
Dynamic Dropdowns 15 32
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
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…

860 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