Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Image index in javascript
Name: geoshrad Date: September 24, 2007 at 09:48:20 Pacific OS: Win XP CPU/Ram: Pentium Product: Web
Comment:
When i use an event handler in javascript, i will be able to get the name of the image by using event.srcElement.
But this method does not work in firefox.
What is the alternate method to get the name or index of the image in firefox for a an event.
Name: geoshrad Date: September 26, 2007 at 12:47:40 Pacific
Reply:
I got the solution.
I must use to following code to get it
var element = evt.target || window.event.srcElement;
that was the only thing which i ws looking for
function openWindow(url, evt) { //popupWin = window.open(url, name, 'scrollbars,resizable,width=850,height=700'); //alert("hallo"); var element = evt.target || window.event.srcElement; //alert(element.src); //create a new div and include the image there if( element.width<600) { //alert(evt.target); element.width=600; element.style.position="absolute"; var file=element.src.indexOf("thumps"); var path=element.src.substring(0,file); var name=element.src.substring(file+7,file+14); element.src=path+name; //element.refresh; } else { element.width=200; element.style.position="static"; }
Summary: Hello! Im trying to insert an image using javascript. My problem is, i cant use the standard: document.images["image_name"] This is because the image is in a totally different folder. I have a variabl...
Summary: when my website comes up in a search engine the title comes up as "INDEX" rather than a title or description.obviously the homepage is index in my root folder but how can i change this on an engine?i ...
Summary: I've been creating a website, and my favoured way to do is is create a table and use images across the top and down the left hand side for navigation and effect. The only problem is, don't want the b...