473,758 Members | 7,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change images

Hi Folk and Gurus

This may help some of you (though probably not the gurus), in changing
images:

http://www.sunnysideup.co.nz/j/imageChange/

Any feedback appreciated.

Cheers

Nicolaas

Aug 4 '07 #1
14 1969
On Aug 4, 4:51 am, windandwaves <nfranc...@gmai l.comwrote:
Hi Folk and Gurus

This may help some of you (though probably not the gurus), in changing
images:

http://www.sunnysideup.co.nz/j/imageChange/

Any feedback appreciated.
XHTML 1.1 is not appropriate for Web pages. Certainly you don't want
to serve it as text/html.

Preloading the images via an innerHTML assignment is odd and far less
compatible than the usual method of creating Image objects.

Unless you plan to create a page to display the pictures without
scripting, you should make the images, captions and containing DIV's
static content. You don't need to use innerHTML at all with this
approach. Just display one DIV at a time.

Aug 4 '07 #2
windandwaves said the following on 8/4/2007 4:51 AM:
Hi Folk and Gurus

This may help some of you (though probably not the gurus), in changing
images:

http://www.sunnysideup.co.nz/j/imageChange/

Any feedback appreciated.
That would have to be about the worse way/example of an image change
script as I have seen in a very long time.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 4 '07 #3
windandwaves wrote:
This may help some of you (though probably not the gurus), in changing
images:

http://www.sunnysideup.co.nz/j/imageChange/

Any feedback appreciated.
Works in Firefox 2.0.0.6 and Opera 9.22 on Windows XP, however:

- You are serving XHTML 1.1 as text/html, which is recommended
against per W3C Note "XHTML Media Types".
- You are serving XHTML that is not HTML-compatible as per XHTML 1.0,
Section C, as text/html. (We are gracefully ignoring that there is
no such allowance of HTML compatibility for XHTML 1.1 anyway.)
- You are serving XHTML where HTML 4.01 would have sufficed.
- You are declaring UTF-8 in a meta element that is ignored by an XML
parser; the corresponding XML declaration, which would not be required
if the Content-Type header was set appropriately, is missing.
- You are using the proprietary "author" value instead of the
"DC.Creator " or "DCTERMS.creato r" from the Dublin Core Metadata
standard (ISO 15836-2003).
- By serving as text/html (see above) this is parsed by an
SGML-based parser. However, ETAGOs in the `script' element have not
been escaped.
- Does not work in NN4 because of "className" switching, although NN4
is capable of both hiding and switching the image and its description.
- The feature test for all W3C DOM methods called is missing.
- You are mixing W3C DOM Level 2 HTML with the proprietary innerHTML
property without testing for the latter.
- W3C DOM Level 2 and innerHTML are used without being required,
and no alternative is provided.
- Vertical offset of the image is too great (wrong) in IE 7.
- Hard to maintain because images are identified by number instead
of by name.

And probably I have forgotten something else.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not the
best source of advice on designing systems that use javascript.
-- Richard Cornford, <f8************ *******@news.de mon.co.uk>
Aug 4 '07 #4
On Aug 4, 9:24 pm, David Mark <dmark.cins...@ gmail.comwrote:
On Aug 4, 4:51 am, windandwaves <nfranc...@gmai l.comwrote:
Hi Folk and Gurus
This may help some of you (though probably not the gurus), in changing
images:
http://www.sunnysideup.co.nz/j/imageChange/
Any feedback appreciated.

XHTML 1.1 is not appropriate for Web pages. Certainly you don't want
to serve it as text/html.

Preloading the images via an innerHTML assignment is odd and far less
compatible than the usual method of creating Image objects.

Unless you plan to create a page to display the pictures without
scripting, you should make the images, captions and containing DIV's
static content. You don't need to use innerHTML at all with this
approach. Just display one DIV at a time.
Thanks for your help, I have made the changes....

Aug 5 '07 #5
On Aug 4, 10:09 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
windandwaves said the following on 8/4/2007 4:51 AM:
Hi Folk and Gurus
This may help some of you (though probably not the gurus), in changing
images:
http://www.sunnysideup.co.nz/j/imageChange/
Any feedback appreciated.

That would have to be about the worse way/example of an image change
script as I have seen in a very long time.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptT oolbox.com/bestpractices/
I have changed it...

Aug 5 '07 #6
On Aug 4, 11:33 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:

Thanks for all the great notes! Although I am definitely not worried
about NN4.0, it is great to read all these possible improvements.

Does it look better now?

http://www.sunnysideup.co.nz/j/imageChange/

Thank you

Nicolaas
windandwaves wrote:
This may help some of you (though probably not the gurus), in changing
images:
http://www.sunnysideup.co.nz/j/imageChange/
Any feedback appreciated.

Works in Firefox 2.0.0.6 and Opera 9.22 on Windows XP, however:

- You are serving XHTML 1.1 as text/html, which is recommended
against per W3C Note "XHTML Media Types".
- You are serving XHTML that is not HTML-compatible as per XHTML 1.0,
Section C, as text/html. (We are gracefully ignoring that there is
no such allowance of HTML compatibility for XHTML 1.1 anyway.)
- You are serving XHTML where HTML 4.01 would have sufficed.
- You are declaring UTF-8 in a meta element that is ignored by an XML
parser; the corresponding XML declaration, which would not be required
if the Content-Type header was set appropriately, is missing.
- You are using the proprietary "author" value instead of the
"DC.Creator " or "DCTERMS.creato r" from the Dublin Core Metadata
standard (ISO 15836-2003).
- By serving as text/html (see above) this is parsed by an
SGML-based parser. However, ETAGOs in the `script' element have not
been escaped.
- Does not work in NN4 because of "className" switching, although NN4
is capable of both hiding and switching the image and its description.
- The feature test for all W3C DOM methods called is missing.
- You are mixing W3C DOM Level 2 HTML with the proprietary innerHTML
property without testing for the latter.
- W3C DOM Level 2 and innerHTML are used without being required,
and no alternative is provided.
- Vertical offset of the image is too great (wrong) in IE 7.
- Hard to maintain because images are identified by number instead
of by name.

And probably I have forgotten something else.

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not the
best source of advice on designing systems that use javascript.
-- Richard Cornford, <f806at$ail$1$8 300d...@news.de mon.co.uk>

Aug 5 '07 #7
On Aug 5, 2:31 am, David Mark <dmark.cins...@ gmail.comwrote:
On Aug 5, 1:58 am, windandwaves <nfranc...@gmai l.comwrote:
[snip]
>
Missing closing bracket. You don't need the rule anyway as
Disregard the second sentence. Currently it is needed when scripting
is disabled. Preferably, I would put the captions in their own DIV's,
which will make it look better when CSS is disabled.

Also, the numbered links' href's should point to anchors for each
image. Furthermore, I would return true from the onclick handlers to
cover the situation where scripting is enabled, but CSS is not.

The main thing to remember with something like this is to test without
script, without style and without either. It has to make sense in all
three cases.

One other note. In the current example, the alternative text for the
images runs into the captions when images are disabled. Regardless, I
think the only logical alternative text for these images is "".

Aug 5 '07 #8
Thanks again, all of you for the comments, I have further updated the
page:

http://www.sunnysideup.co.nz/j/imageChange/

Nicolaas
Aug 6 '07 #9
On Aug 7, 12:37 am, David Mark <dmark.cins...@ gmail.comwrote:
[snip]
>
Anyway, you still had several problems. Here is a more reliable and
unobtrusive version of the. I made a few style changes too.
One note on the revised version. Add a rule to the script-added style
block to hide the menu as well. It won't be able to do anything while
the page is loading and style is enabled.

And I just noticed that you still have alternate text for the images.
Change the alt attributes to "".

Aug 7 '07 #10

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

Similar topics

1
3219
by: Spike | last post by:
Hello! Im going to make a javascript for changing alot of images. But im not sure how to do it., where to start.. Ok, first.. this is the isue. I have 3 images(I call them 1a-3a). when u click on image 1a u change" image x" to image 1a when u click on image 2a u change" image x" to image 2a when u click on image 3a u change" image x" to image 3a
4
44332
by: Nathan Given | last post by:
Hello All, I am trying to randomly change the background image of my home page but I can't seem to figure it out. Here is a snippet of my css .... BODY {background:transparent url(../images/homepagebg3.jpg) no-repeat; font:normal 90% Arial, Helvetica, sans-serif; color:#263158;}
2
1863
by: Nick Calladine | last post by:
Is this possible to ... I wish to get the value of a dropdown select but gets is indexable value (dont know if that is the right term) if that is possible (the position it assigned get assigned by the position on the list) this is so i can then pass it to the array called pictureimage to get the correct filename (similar to the picturetext part of this routine) and then the final line on the fuction is to change an original image with...
2
8535
by: Sanjeeva Reddy | last post by:
hai Anti Keskinen, i have used the following code MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100, 100); // Sets large image size to 100, 100 here i am getting error like "gcnew is undeclared error",how to deeclare 'gcnew" and when i am using in runtime to change the size of images in imagelist in listview control in .net(forms application) by chnging one trckbar(like tb1->Value),
4
1998
by: Shapper | last post by:
Hello, I have this image in my HTML code: <img src="images/en-US/myImage.jpg" /> I want to change the URL using the value of a Session variable. <img src="images/ Session("culture") Value /myImage.jpg" /> This is what I did: <img src='images/<%# Session("culture") %>/myImage.jpg' />
16
2047
by: Giggle Girl | last post by:
Hi there, I have a nav tree similar to the XP Windows Explorer in behavior. It uses styles to underline a row on mouseover, and change the look of a row when clicked. Currently, it is working fine using CSS/Javascript, by calling functions that underline and highlight by passing in IDs. The problem is, I do not want to pass in IDs. Currently it has one the TDs to be changed, but I may need to add one for images (to change the
1
1753
by: roN | last post by:
Hi, I have a table in which I would like to change the background image onMouseOver. I implemented it with CSS but IE doesn't support hovers on tables, so I'd need to go via JS for IE. Can anyone give me a hint how to do this? So far it looks like: <tr> <td class="frontbar"> <a href="#"><img src="images/dot.gif" width="10"
3
3190
by: vj | last post by:
how to change images based on action. Even clicking changed images should do respective actions. and while displaying only one image at a time sholud get displayed. I am using three images for a single column of a table in Jsp. Any clues. Any link for any good javascript html jsp site where i can find some good solution. here swaping hiding which will work well.
9
3017
by: shoeyoz | last post by:
Hi Everybody, m suyoz, i have made body color change onmouse click in every webpages but what i want is dat when i choose for eg blue body color .after dat when i click on link to other page i want same color which i have chosen before .. so please help me..
1
2675
by: rockdale | last post by:
Hi, all I am change my webpage to using div and css for my layout, it was using table before and I want to get rid of it. Basically it draws a box around my content using background pictures, but I can not get the left-border and right-border of the box working using div. Anybody can help me? Thanks in advance
0
9317
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10090
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9924
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9758
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8759
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7310
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3423
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.