Help! CSS and Javascript Photo Gallery

Discussion in 'Web Design and Development' started by Chacala_Nayarit, Mar 4, 2006.

  1. macrumors 6502

    Chacala_Nayarit

    Joined:
    Oct 6, 2005
    Location:
    Lakewood, Washington
    #1
    This tested fine in Firefox, but IE 6 does not render. Meaning when the photos are clicked they do not open in a new window. http://rainiersupply.com/gallery.html


    Code:
    <ul id="albumlist">
    	<li><a href="javascript:void(0)" onclick="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a></li>
    IE 6 displays an error in the corner of the browser says something like invalid argument line: {every picture}, Code: 0, blah, blah, blah... :mad:

    Where did I go wrong? Is there a better way to achieve this goal?
     
  2. Guest

    #2
    I'm not in frpnt of a PC at the moment but I don't think IE6 PC likes void(0);

    So (as an example) replace

    Code:
    <a href="javascript:void(0)" onclick="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
    with

    Code:
    <a href="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
     
  3. thread starter macrumors 6502

    Chacala_Nayarit

    Joined:
    Oct 6, 2005
    Location:
    Lakewood, Washington
    #3
    Unfortunately the above code does not work. I just put an image link to get Firefox. So if they want to view the pictures, well than they have too download Firefox.:p
     
  4. macrumors 6502

    Coolnat2004

    Joined:
    Jan 12, 2005
    #4
    Hmm.. try this:
    Code:
    <a href="#" onclick="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
     
  5. macrumors 6502

    Joined:
    Nov 10, 2005
    Location:
    New South Wales, Australia
    #5
    This will work:

    Code:
    <a href="javascript:window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
    
     
  6. Administrator

    Knox

    Staff Member

    Joined:
    Jul 1, 2002
    Location:
    UK
    #6
    The way I normally do new windows in javascript is: (untested)

    Code:
    <a href="/images/500ftMCM.jpg" target="_blank" onClick="window.open(this.href, 'new', 'width=500,height=375');return false;"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
    
    This means that browsers without javascript enabled will work as normal, opening the image in a full size window.
     
  7. macrumors 65816

    redeye be

    Joined:
    Jan 27, 2005
    Location:
    BXL
    #7
    Just a remark on the side:

    Although your javascript says 'width=500,height=375' and your image all are 500 x 375 the new window that opens always has scrollbars when i open them.

    The actual part of the image shown is 485 x 359.
    Shouldn't Safari (2.0.3) just show the image if it fits, it's by putting those bars that you need them.

    Couldn't come up with a tag for forcing 'no scrollbars' on a new window, then again i really didn't look so hard.

    Firefox (Mac and PC) and camino show the image in a window bigger than the set size.

    Anyhow, i'm sorry for this OT post.

    Cheers
     
  8. thread starter macrumors 6502

    Chacala_Nayarit

    Joined:
    Oct 6, 2005
    Location:
    Lakewood, Washington
    #8
    Thank you! that's the one that works! I changed a few of them, but I stopped until the billing starts at 8:00am tomorrow. :D
     

Share This Page