473,396 Members | 1,799 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,396 software developers and data experts.

right idea.....but lost somewhere

This simple change to dynamicdrive's textual tooltip does what I want
perfectly.
(whichcontent) determines which group of thumbs will be shown.
My color coded editor is showing me that something is not quite kosher and I
can't figure out what it is.
Everything appears to be fine up until you get to i<10 then it screws up.

I know everything else works fine.
With a click, I can put a single image into my "middle" column with ease.
But I want to show the entire group of thumbs, not just one.

Any clues appreciated.

function changethumbs(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById?
document.getElementById("middle"):document.all.mid dle
counter=0
for (i=1; i<10; i++){
counter=counter+1
cross_el.innerHTML='<img src="images/pic"+i+".jpg">'

}
}

}
Jul 23 '05 #1
4 992
Screw it. This innerhtml thing is not gonna do what I need done no way.
Jul 23 '05 #2
Richard wrote:
This simple change to dynamicdrive's textual tooltip does what I want
perfectly.
(whichcontent) determines which group of thumbs will be shown.
My color coded editor is showing me that something is not quite kosher and I
can't figure out what it is.
Everything appears to be fine up until you get to i<10 then it screws up.
i<10 means that it will stop when i reaches 9.

I know everything else works fine.
With a click, I can put a single image into my "middle" column with ease.
But I want to show the entire group of thumbs, not just one.

function changethumbs(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById?
document.getElementById("middle"):document.all.mid dle
this can be written a little more legibly as:

if (document.getElementById){
var cross_el = document.getElementById('middle');
} else if (document.all) {
var cross_el = document.all['middle'];
}
counter=0
Don't know what "counter" is for, but make it local if not needed as
global:

var counter = 0;
for (i=1; i<10; i++){
This for loop will iterate 9 times, from 1 to 9 inclusive. If you want
more, say 20, change i<10 to i<=20.
counter=counter+1
cross_el.innerHTML='<img src="images/pic"+i+".jpg">'


"cross_el" must be a div or span or similar, so this can be
replaced by:

if (document.createElement) {
counter++;
var image = document.createElement('img');
image.src = 'images/pic' + i + '.jpg';
image.alt = 'nothing';
cross_el.appendChild(image);
}

[...]

--
Rob
Jul 23 '05 #3
Thanks Rob I'll look into it.

Jul 23 '05 #4
I must be missing something because I can't get your idea to work right.
Thanks for the lesson.
Jul 23 '05 #5

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

Similar topics

12
by: skeeterbug | last post by:
http://www.geocities.com/operationsengineer1/test2.htm the extra space between the logoHeader and the menu bar occurs when i add the <ul>. if i comment out the ul and and all the li, the 1em...
22
by: Simon | last post by:
Hi, I have written a function to trim char *, but I have been told that my way could be dangerous and that I should use memmove(...) instead. but I am not sure why my code could be 'dangerous'...
8
by: Gernot Frisch | last post by:
Hi, I get these errors, but I'm totally lost. It's a large cpp file and I don't know where to search for the error, since it does not point to any of my code lines. Can someone suggest where to...
6
by: Paul H | last post by:
Hi I have a problem with certain users of my ASP.NET application. The user logs into the site, and they are logged into the application. Then when they select a link, they are presented with a...
2
by: sara | last post by:
I have been working this idea for a little over a week now and am not convinced I have a good solution. I have a little system that tracks Purchase Orders (POKey autonum, PONum are both ont...
8
by: Anthony Smith | last post by:
I am looking into building a web application and one of the things I want to do is to make sure the user is logged in. I know I can do this by checking the session for a user object or something...
7
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize,...
6
by: Ricardo Vazquez | last post by:
Hello everybody, I'm programming a TCP server. During the stress tests I noticed that maybe my socket-receiving thread became deaf after an hour of heavy stress. I think that the reason could...
52
by: marc | last post by:
Hello, Is it possible to right pad with "0" (or other character != blank) ? for example : 1 , length 10 ="1000000000" I've tried with sprintf but I can only left pad with "0" or right pad with...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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,...

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.