Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Browser Compatibility Help

Status
Not open for further replies.

emblewembl

Programmer
May 16, 2002
171
GB
Hi all, I very rarely have to write any javascript and have just done a site for a friend which needs javascript to load a big image onto the screen when any thumbnail is clicked. Basically it all works exactly as we want in IE 6 but I am interested in how this javascript will work in other browsers and if there is anything that I can do to ensure that it works in as many as possible.

The main javascript function that I am concerned about is:


Code:
function showImage(    url, iname    )
    {
        var portraitImage = iname;
        
        document.getElementById( "bigImage" ).src = url;
        
        if (portraitImage == "True"){
        document.getElementById( "bigImage" ).style.width = "200px";
        document.getElementById( "bigImage" ).style.height = "301px";
        }
        else
        {
        document.getElementById( "bigImage" ).style.width = "301px";
        document.getElementById( "bigImage" ).style.height = "200px";
        }
}
and the url of the (non public) website is
Thanks.


i love chocolate
 
That code looks cross-browser to me.

However, your site doesn't look at all good in Firefox 1.5 - the site is really, really wide, and you have to scroll the whole page (not just the thumbnails), which means any time you want to see a large version, you have to re-centre the page.

You could probably ask in the HTML forum (forum215) about fixing this.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi Dan, thanks for that. Funnily enough I knew about the Firefox problem and was going to ask for help on that one as well! Thanks

i love chocolate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top