![]() |
#1
|
||||
|
||||
![]()
Can anyone familiar with javascript tell me how to make this scroll horizontal instead of vertical?
Code:
//##########################################################################// // Scrolling background Tutorial Code by http://www.kudoswebsolutions.com // Original Source code: http://youlove.us/ // Modified and extended by Kudos Web Solutions // copyright 2009 kudoswebsolutions.com //##########################################################################// $(function() { // Define the height of your two background images. //The image to scroll var backgroundheight = 2000; //The image to overlay var backgroundheight_two = 1000; // Create a random offset for both images' starting positions offset = Math.round(Math.floor(Math.random()* 2001)); function scrollbackground() { //Ensure all bases are covered when defining the offset. offset = (offset < 1) ? offset + (backgroundheight - 1) : offset - 1; // Put the background onto the required div and animate vertically $('#container').css("background-position", "50% " + offset + "px"); // Enable the function to loop when it reaches the end of the image setTimeout(function() { scrollbackground(); }, 100 ); } function scrollbackground2() { //Ensure all bases are covered when defining the offset. offset = (offset < 1) ? offset + (backgroundheight - 1) : offset - 1; // Put the background onto the required div and animate vertically $('#container2').css("background-position", "50% " + offset + "px"); // Enable the function to loop when it reaches the end of the image setTimeout(function() { scrollbackground2(); }, 100 ); } // Initiate the scroll scrollbackground(); scrollbackground2(); // Use the offset defined earlier and apply it to the div. $('#overlay').css("background-position", "50% " + offset2 + "px"); $('#overlay2').css("background-position", "50% " + offset2 + "px"); }); |
#2
|
||||
|
||||
![]()
I'm almost sure you noticed this, especially as (judging from your site) you have more experience than me. However I'll post it anyways in case it got overlooked or something...
" offset = (offset < 1) ? offset + (backgroundheight - 1) : offset - 1; // Put the background onto the required div and animate vertically $('# " Do you think changing the "vertically" on both background things to "horizontally" would fix that? I'm sorry if you already tried this.. or if maybe it won't do anything at all to edit it.. just a thought/suggestion. (I can't make codes, but /sometimes/ I can edit /little/ things if I can figure out what it does and how to move it. Though its a slow process ...) |
#3
|
||||
|
||||
![]()
That part is just a comment so changing the words won't fix it :/ Thanks for trying though
![]() |
#4
|
||||
|
||||
![]()
jQuery
stock overflow Well since that didn't help, I did a google.. maybe one of these will help. The first one seems more like a software.. the second one seems more like a guide.. |
#5
|
||||
|
||||
![]()
Eh... nothing there is helping me. This is so frustrating.
|
#6
|
||||
|
||||
![]()
I worked ALL day on this!! How does it look?
http://taleofdragons.net/adopt.php |
#7
|
||||
|
||||
![]()
umm looks like your css is somewhat messed up, I see eggs appearing below the template footer...
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#8
|
||||
|
||||
![]()
Do a hard refresh....
|
#9
|
||||
|
||||
![]()
OH! No wonder those didn't help ^^;;
I misunderstood and thought you wanted a horizontal scrollbar.. *facepalms* Sorry -,- It looks awesome silver, kind of mysterious. |
#10
|
||||
|
||||
![]()
Thanks! ^^
|
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Javascript and Mysidia | Abronsyth | Questions and Supports | 5 | 09-06-2014 07:22 PM |
Javascript included in PHP? | Aasixx | Questions and Supports | 2 | 10-30-2012 02:46 AM |
\\Javascript Help, Please// | Poppy | Questions and Supports | 0 | 11-06-2011 11:28 AM |
Javascript help? | AlexC | Programming and Game Development | 0 | 07-19-2011 06:22 AM |
Anyone here knows Javascript? | Hall of Famer | Other Chat | 5 | 04-06-2011 07:21 PM |
What's New? |
What's Hot? |
What's Popular? |