473,748 Members | 4,951 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 1336

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

Similar topics

17
1666
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
1363
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
3059
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
1596
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
3441
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
5014
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
1526
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
8989
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
9537
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...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
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...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
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
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
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...
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.