Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-29-2012, 04:13 PM   PM User | #1
juanc
New Coder

 
Join Date: Aug 2006
Posts: 32
Thanks: 3
Thanked 0 Times in 0 Posts
juanc is an unknown quantity at this point
Jquery ScrollTo covers a greater distance on each click

Hi I was hoping someone could help.

I'm using the ScrollTo jquery plugin..and on each click to scroll towards the left it incrementally covers a greater distance....conversely clicking to scroll towards the right sending the items back the other way incrementally covers a lesser distance.

You can see the example

here http://psd2htmlservice.com/scrolltest/index2.html

I was wondering if people could view the source to have a better look at what's going on but the actual code I'm using to invoke the function is this

Code:
<script language="javascript" type="text/javascript">
$(document).ready(function() { 
    	   
            
      $("#streetstyles_right_arrow").click(function(){
      $("#streetstyles-pane").scrollTo({top:'+=0px',left:'+=470px'}, 370);
      $("#streetstyles-pane2").scrollTo({top:'+=0px',left:'+=470px'}, 370);
      });

      $("#streetstyles_left_arrow").click(function(){
      $("#streetstyles-pane").scrollTo({top:'+=0px',left:'-=470px'}, 370);
      $("#streetstyles-pane2").scrollTo({top:'+=0px',left:'-=470px'}, 370);
      });
            
      });
      
</script>
Any help would be much appreciated.
juanc is offline   Reply With Quote
Old 10-29-2012, 07:40 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
why are you putting += and -= on the css properties?
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 10-29-2012, 07:51 PM   PM User | #3
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
also part of your pblem lies in your margins and padding for the LI's
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:55 AM.


Advertisement
Log in to turn off these ads.