473,699 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to remain bottom the scroll bar using javascript/jquery?

Exequiel
288 Contributor
My problem here is that the scroll bar is not staying in bottom, after loading the data using ajax the scroll bar still on top. but when i place the code for positioning the scroll bar at the bottom before doing the function see_message_tor eply(deskid); it works, but after doing this function its not working. . can any body help me my problem?:)
Expand|Select|Wrap|Line Numbers
  1.  
  2. function save_reply(theuser, deskid)
  3. {
  4.     var reply = $("textarea[name=reply_fields]").val();
  5.  
  6.     if(reply!="")
  7.     {
  8.         //when i put it here it works!
  9.  
  10.         if(reply.length >= 10)
  11.         {
  12.  
  13.             $.ajax({
  14.                 type:'post',
  15.                 url:URL+"index.php/company/save_reply",
  16.                 data:{
  17.                     theuser:theuser,
  18.                     deskid:deskid,
  19.                     message_reply:reply
  20.                 },
  21.                 success: function(replyz)
  22.                 {
  23.                     if(replyz == 1)
  24.                     {
  25.                         see_message_toreply(deskid);
  26.                         $("textarea[name=reply_fields]").val('');
  27.  
  28.                         var div = $('#main_scrol_reply');
  29.                         div.delay(5000).scrollTop( div.get(0).scrollHeight );//scroll to bottom not work after loading the data, this is my problem
  30.                     }
  31.                 }
  32.             });
  33.         }
  34.         else
  35.         {
  36.             $('#pop_msg').fadeOut('fast').html("Reply too short.").removeAttr("class").attr('class','errormsg').fadeIn('fast').delay(5000).fadeOut('fast').draggable({revert: false,containment: 'body',handle:'#pop_msg'});    
  37.         }
  38.     }
  39. }
  40.  
  41.  
Aug 15 '13 #1
0 1335

Sign in to post your reply or Sign up for a free account.

Similar topics

17
1658
by: compassSoftware | last post by:
Hi, I have two horizontal frames, one on top of the other. The top frame is an image map of a street with property boundary's on it. The bottom frame is a table with each row of the table holds details about a perticular property from the image map above.
1
1361
by: keerthana_m_2003 | last post by:
Hello: I am designing a web page where there are some buttons text etc. I want to design it in such a way that, irrespective of the screen size, resolutoin; the buttons will have to come always in middle, heading always on top middle etc. Some buttons always on bottom left (100 px away from screen bottom) etc... How can i do this using javascript or CSS/ Thanks
2
3052
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is what I'm hoping to achieve. I've never before had to use Javascript closures, but now I do, so I'm making an effort to understand them. I've been giving this essay a re-read: http://jibbering.com/faq/faq_notes/closures.html
3
1584
by: nskclr | last post by:
Hi I add a text using document.selection.createRange(). I want to add a text to the bottom of another text - similar to what we do in HTML. <p> xyz </p> <p><div style="position:relative;bottom:30px;">abc</div></p> How can I achieve that using javascript?
2
3431
by: rohitaya | last post by:
hi , i m building a texteditor using javascript whose functions like MS Front Page.so ,how i can give the effect bold,underline,italic using javascript on button click& if i press again button(ex.bold)then selected text must be as remain as it prevoius.plz help me if anybody know its answers.
7
5013
by: coolnags | last post by:
Hi, As we know IE SELECTdrop down list has limitations on tool tip on individual option items and also horizontal scroll bar. Can any one please tell any other alternative to show the tool tip using javascript or has any one implemented drop down list using div which has all the functionalites of drop down list. Thanks, Nags
1
1523
by: Kurri | last post by:
How to get the text from many CSS files and merge them into one file using javascript to avoid overhead at server side. Using C# or ASP.NET or Javascript or JQuery....
0
8686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9033
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6533
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.