User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,405 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,365 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 858 | Replies: 1
Reply
Join Date: Jun 2007
Posts: 15
Reputation: saswati_mishra is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
saswati_mishra saswati_mishra is offline Offline
Newbie Poster

javascript issue

  #1  
Jun 20th, 2007
Hi, I have two images, one looks like the up arrow button of a vertical scrollbar and the other looking like the down arrow button of a vertical scrollbar.

I want that when an user clicks on the up arrow button the contents of a table to scroll up and when the down arrow button is clicked the contents of the table to go down.

Please help!!!!!!!!!
Thanks in advance
Saswati
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2007
Location: Birmingham
Posts: 378
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 37
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Re: javascript issue

  #2  
Jun 20th, 2007
do you want the contents to move one click at a time or similiar to a scroll bar. if a scrollbar. why not use a <div style="overflow:scroll;"></div>

im guessing you could do an
<head>
  <script language='javascript'>
    function move(amount) {
      val margin = document.getElementById('content').style.marginTop();
      amount = parseFloat(margin) + amount;
      document.getElementById('content').style.marginTop= amount.toString() + 'px';
}
  </script>
</head>
<body>
  <p><a href="#" onclick="move(5)"><img src="up"></a>
  <a href="#" onclick="move(-5)"><img src="up"></a></p>

  <table>
    <tr>
      <td id="content"><p>blah blah</p></td>
    </tr>
  </table>
</body>

this is untested so i dunno but i rekon thats a basis of what you should do.

hope it helps
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 1:32 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC