473,378 Members | 1,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to make a vertical thumbnail scroller horizontal

hello. happy new year.

I'm trying to build a website for my wife and she is adament on having
a horizontal thumbnail scrolling div. great. I have a good vertical
scrolling thing, but can't figure out how to make it scroll
horizontally. It's probably real simple and I just can't figure it
out....

Here is the code I have so far:

<html>
<head>
</head>
<body>
<script language='javascript' type='text/javascript'>

var scrolling;

function startScroll(theframe)
{
scrolling=setInterval('window.' + theframe +
'.scrollBy(0,12);', 100);
}

function stopScroll()
{
clearInterval(scrolling);
}

function back(theframe)
{
scrolling=setInterval('window.' + theframe +
'.scrollBy(0,-12);', 100);
}

</script>

<a href='javscript:void(0);' onmouseover='back("this_iframe")'
onmouseout='stopScroll()'>Scroll Up</a><br />
<iframe src='' name='this_iframe' id='this_iframe'
style='width: 50px; height: 50px;' frameborder='0' scrolling='no'
/></iframe><br />
<a href='javascript:void(0);'
onmouseover='startScroll("this_iframe")'
onmouseout='stopScroll()'>Scroll Down</a><br />

<script language='JavaScript' type='text/javascript'>
frames['this_iframe'].document.open();
frames['this_iframe'].document.write("<html><head><body>");
frames['this_iframe'].document.write("<img src='image1.jpg'
style='width: 25px; height: 25px;' /><br />");
frames['this_iframe'].document.write("<img src='image2.jpg'
style='width: 25px; height: 25px;' /><br />");
frames['this_iframe'].document.write("</body></html>");
frames['this_iframe'].document.close();
</script>

</body>
</html>

I ain't no programmer, although I'm learnin, so don't rip me a new one
if it's easy, pleeeeeas?

Jan 2 '07 #1
3 5339
lolo schreef:
hello. happy new year.

I'm trying to build a website for my wife and she is adament on having
a horizontal thumbnail scrolling div. great. I have a good vertical
scrolling thing, but can't figure out how to make it scroll
horizontally. It's probably real simple and I just can't figure it
out....

Here is the code I have so far:

<html>
<head>
</head>
<body>
<script language='javascript' type='text/javascript'>

var scrolling;

function startScroll(theframe)
{
scrolling=setInterval('window.' + theframe +
'.scrollBy(0,12);', 100);
}

function stopScroll()
{
clearInterval(scrolling);
}

function back(theframe)
{
scrolling=setInterval('window.' + theframe +
'.scrollBy(0,-12);', 100);
}

</script>

<a href='javscript:void(0);' onmouseover='back("this_iframe")'
onmouseout='stopScroll()'>Scroll Up</a><br />
<iframe src='' name='this_iframe' id='this_iframe'
style='width: 50px; height: 50px;' frameborder='0' scrolling='no'
/></iframe><br />
<a href='javascript:void(0);'
onmouseover='startScroll("this_iframe")'
onmouseout='stopScroll()'>Scroll Down</a><br />

<script language='JavaScript' type='text/javascript'>
frames['this_iframe'].document.open();
frames['this_iframe'].document.write("<html><head><body>");
frames['this_iframe'].document.write("<img src='image1.jpg'
style='width: 25px; height: 25px;' /><br />");
frames['this_iframe'].document.write("<img src='image2.jpg'
style='width: 25px; height: 25px;' /><br />");
frames['this_iframe'].document.write("</body></html>");
frames['this_iframe'].document.close();
</script>

</body>
</html>

I ain't no programmer, although I'm learnin, so don't rip me a new one
if it's easy, pleeeeeas?
1. Probably place the thumbnails side-by-side by removing the <br />
newlines.
2. Change scrollBy(0,12) to scrollBy(12,0) and scrollBy(0,-12) to
scrollBy(-12,0). (The first value is the horizontal scroll, the second
value is the vertical scroll.)
3. Probably change the words Scroll Up and Scroll Down to Scroll Left
and Scroll Right.
4. Let me know if anything doesn't work, I didn't test this.
Jan 4 '07 #2
Dan

Wives!

I am looking for the same thing. Not for my wife though (thank God)

I've been trying to do it with a div but your iframe technique looked
interesting and I semi-accomplished horizontal scrolling by making the
follwing changes.

First of all you have to reverse the co-ordinates in both scrollBy()
calls;

in the startScroll function, change "scrollBy(12,0)" to
"scrollBy(0,12)"

and

in the back function change, "scrollBy(-12,0);" to "scrollBy(0,-12);"

Then where the pictures are being added, I removed the <br /tags
after every thumbnail.

Now here's where it all goes sour. Even though I removed the <br />
tags after each thumbnail, the iframe still displays the thumbnails
vertically (the next thumbnail is displayed below the previous one -
not beside it). I am thouroughly embarrased to report that the only
way i can get around this is to use a table... So I drop a table
opener and closer in with the iframe's body tags then surround each
thumbnail with column tags (<tr>thumb</td>).
If anyone knows CSS to make images display horizontally inline within a
narrow div or iframe, please step forward...

Here is my version:

<html>
<head>
</head>
<body>
<script language='javascript' type='text/javascript'>

var scrolling;

function startScroll(theframe){
scrolling=setInterval('window.' + theframe + '.scrollBy(12,0);', 100);
}

function stopScroll(){
clearInterval(scrolling);
}

function back(theframe){
scrolling=setInterval('window.' + theframe + '.scrollBy(-12,0);',
100);
}

</script>

<a href='javscript:void(0);' onmouseover='back("this_iframe")'
onmouseout='stopScroll()'>Scroll Up</a>
<br />
<iframe src='' name='this_iframe' id='this_iframe' style='width: 50px;
height: 50px;' frameborder='0' scrolling='no'/>
</iframe><br />
<a href='javascript:void(0);' onmouseover='startScroll("this_iframe")'
onmouseout='stopScroll()'>Scroll Down</a><br />

<script language='JavaScript' type='text/javascript'>
frames['this_iframe'].document.open();
frames['this_iframe'].document.write("<html><head><body><TABLE><TR>");
frames['this_iframe'].document.write("<TD><img src='image1.jpg'
style='width: 25px; height: 25px;'></TD>");
frames['this_iframe'].document.write("<TD><img src='image2.jpg'
style='width: 25px; height: 25px;'></TD>");
frames['this_iframe'].document.write("</TR></TABLE></body></html>");
frames['this_iframe'].document.close();
</script>

</body>
</html>
--
Dan
Visit http://www.hostingforum.ca today

Jan 14 '07 #3
The problem with horizontal strips is that the browser will fold the
thumbnail images as soon as they fill the horizontal width. I found
that I could defeat that behavior using the "white-space" style. I
created a div and gave it the class "imageStrip" and then used this
style:

..imageString { white-space: nowrap; overflow: auto; width: 95%; }

Then I added the thumbnail images to the div. The "white-space: nowrap"
style prevented them from wrapping and the "overflow: auto" style
generated a scrollbar when needed.

My own wife suggest this and I looked up the documentation for the
"white-space" style and told her that it would not work because the
documentation I read clearly stated that the *text* would not wrap.
But, it does work both on Firefox and IE. Of course, as someone
mentioned, you can also do this with a table. This seems a litle
cleaner.

Jan 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Harlan Messinger | last post by:
Is IE6 known to have a bug whereby a vertical table cell border (with border-collapse: collapse), instead of stopping at the bottom of a horizontal border, sticks up into it by one pixel? My other...
4
by: Generale Cluster | last post by:
Hello, where can I find an horizontal scroller where I can set the scrolling direction from left to right? Thank you -- elimina unsampdoriano per rispondere via email
3
by: Alex D. | last post by:
does any body knows about some horizontal news scrollers that supports relative position or that resizes automatically to fit the whole horizontal space when viewed in different resolutions? ...
4
by: AndreH | last post by:
Hey all. I've placed a DHTML vertical scroller on my site with code copied from http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_59.html, and it's functioning fine in all...
2
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a...
8
by: marco | last post by:
Hi ! I have this part of code and i can not find out why the scroller is starting from left to right instead RIGHT to LEFT. This is the main part and the scroller is working fine but from the...
1
by: bulldog8 | last post by:
I am working on a picture preview page ... some questions and suggestions have been incorporated already, but the 'user' (i.e. wife!) would like it to be more user friendly (if it isn't one thing,...
0
by: slakmagik | last post by:
Is there a way to declare horizontal positioning (without referring to or changing vertical) or vertical positioning (without referring to or changing horizontal) in a single declaration? ...
1
by: sannysmith | last post by:
Hi All, I need to create a horizontal image scroller with controls i.e.left and right buttons at the end. I do not want it animated or scrolling continuously just static and when the user clicks...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.