Java script help required asap!

If the Ivory Tower is the brain of the board, and the Transformers discussion is its heart, then General Discussions is the waste disposal pipe. Or kidney. Or something suitably pulpy and soft, like 4 week old bananas.

Moderators:Best First, spiderfrommars, IronHide

Post Reply
User avatar
Impactor returns 2.0
Big Honking Planet Eater
Posts:6885
Joined:Sat Sep 22, 2001 11:00 pm
::Starlord
Location:Your Mums
Java script help required asap!

Post by Impactor returns 2.0 » Fri Apr 21, 2006 9:33 pm

ok ive got this java script gallery code from here

http://javascript.internet.com/miscella ... iewer.html

When i download the script as it says and begin to change the image files for files on my computer, it doesnt work!!!

I cant see what im missing, im change both img names on each line of the code, but nothing works...
Image

User avatar
Impactor returns 2.0
Big Honking Planet Eater
Posts:6885
Joined:Sat Sep 22, 2001 11:00 pm
::Starlord
Location:Your Mums

Post by Impactor returns 2.0 » Fri Apr 21, 2006 9:43 pm

Erm ignore i was being stupid - but an image loader using Jscript would be cool if anyone knows of one -

so using the above code, instead of loading all the page large images when the page opens, this will load them when called?
Image

Guest

Post by Guest » Fri Apr 21, 2006 10:02 pm

I just tried it, to see if I could see where you were going wrong (obviously irrelevant now), but the way I see it, it loads the entireity of each image for the small panels(i.e. a 1024x768 image will still be 1024x768, even when the panel is only 90x60), then displays them in the larger panel when called upon.

Of course, it's easy to get around the initial loading problem, by altering the img src="p1.jpg" tag to img src="p1_thumb.jpg" or similar, as long as the doPic('p1.jpg') function is left as-is.

Dynamic HTML using script is an easy way to do client-side effects that would otherwise have to be done using many near-identical static HTML pages (lots of webspace wasted) or server-side effects (not everyone has wanted to fork out for php/cgi/etc.).

User avatar
Denyer
Over Pompous Autobot Commander
Posts:2155
Joined:Tue Oct 17, 2000 11:00 pm
::Yesterday's model
Contact:

Post by Denyer » Fri Apr 21, 2006 10:12 pm

Dunno, these days PHP is a basic on everything above free hosting -- and you can find free PHP-supporting hosts if you look...

What exactly are you trying to do?

If you're using HTML 4.01 Transitional, you can just whack an iframe in the middle and it'll be supported by the main three browsers.

User avatar
Impactor returns 2.0
Big Honking Planet Eater
Posts:6885
Joined:Sat Sep 22, 2001 11:00 pm
::Starlord
Location:Your Mums

Post by Impactor returns 2.0 » Fri Apr 21, 2006 10:45 pm

ok i sorted all my thumbs problems etc - id love to go the other route by have literaly hours remaining so I just need one more bit of help.

I am trying t combine two roll overs.

My buttons have a highlight rollover and it also changes a thumbnail.

ok this works as I want it to by itself.

onmouseover="MM_swapImage('thumb','','images/2dwork/2dthumb/abstractthumb.jpg',1)"


and this also works exactly how i want it to by itself.

onmouseover="MM_swapImage('Image01','','images/buttons/01u.gif',2)"
How can I combine both statements in one single mouse over statement - I just cant work out the syntax, it will only ever view the first statement.
Image

User avatar
Impactor returns 2.0
Big Honking Planet Eater
Posts:6885
Joined:Sat Sep 22, 2001 11:00 pm
::Starlord
Location:Your Mums

Post by Impactor returns 2.0 » Fri Apr 21, 2006 10:53 pm

Ok ive put the page up online.

the first two number buttons show the preview images correctly but they do not have thier own button rollover images as buttons 3-12 do.

so essentialy how do i combine the rollover button highlight with the thumbnail preview?

http://www.impstar.co.uk/2Dworktest.html
Image

Guest

Post by Guest » Fri Apr 21, 2006 11:04 pm

You could try putting the two statements in a function and use the function in the onmouseover statement.

For example:

Code: Select all

impyMouseOver(t1,t2,i1,i2) {
MM_swapimage(t1,'',t2,1);
MM_swapimage(i1,'',i2,2)
}

Code: Select all

onMouseOver="impyMouseOver('thumb','images/2dwork/2dthumb/abstractthumb.jpg','image01','images/buttons/01u.gif')"
Alternatively, it might be possible to use a semicolon to delimit the different MM_swapimage() instructions within a single onMouseOver, but it's not possible to have more than one active onMouseOver in the same tag, as the HTML interpreter can only ever hold one value for each attribute. Interpreters either take the first instance and disregard subsequent ones, or overwrites the value for each new instance encountered, which takes longer to handle.

User avatar
Denyer
Over Pompous Autobot Commander
Posts:2155
Joined:Tue Oct 17, 2000 11:00 pm
::Yesterday's model
Contact:

Post by Denyer » Sat Apr 22, 2006 1:24 pm

onmouseover="MM_swapImage('thumb','','images/2dwork/2dthumb/abstractthumb.jpg',1);MM_swapImage('Image01','','images/buttons/01u.gif',2)"

User avatar
Impactor returns 2.0
Big Honking Planet Eater
Posts:6885
Joined:Sat Sep 22, 2001 11:00 pm
::Starlord
Location:Your Mums

Post by Impactor returns 2.0 » Sat Apr 22, 2006 2:04 pm

am i guessing all that was needed was the ; to seperate them?

Ill give it a go, for now im finnished as its got to be hadned in!

www.impstar.co.uk

Quite happy, I knowits got spacing issues on some pages but not bad for 1 days work.
Image

User avatar
Denyer
Over Pompous Autobot Commander
Posts:2155
Joined:Tue Oct 17, 2000 11:00 pm
::Yesterday's model
Contact:

Post by Denyer » Sat Apr 22, 2006 3:06 pm

Is "Privacy Policy" supposed to be a link?

Looks professional. :)

And you look disconcertingly like my mate Gaz...

edit: Maybe make the first paragraph fully justified, with a fixed margin on the left edge of the photo?

User avatar
Impactor returns 2.0
Big Honking Planet Eater
Posts:6885
Joined:Sat Sep 22, 2001 11:00 pm
::Starlord
Location:Your Mums

Post by Impactor returns 2.0 » Tue Apr 25, 2006 11:24 pm

Cheers for the code I added that to my Gallery buttons and now they look proper swisho!

I justifed the text to the left, the reasoni hadnt before was in Firefox it was on the left where I wanted it? - and IE it wasnt, so I added some more formating to make sure. One thing I do notice is in FF I have these lil square symbols on parts of my text, which is what I wanted but in IE these symbols do not appear... bugger.

The last thing I want to add is some discriptions for each bit of work, ive left a table cell blank above each image and hope to link some txt into that space but for now im quite happy so thank you for all the help as im rather proud of the results and ill be using the site for some time :)

Thank you all again .
Image

Post Reply