Opening new window on click

liunx

Guest
I am trying to create click-able images using MX2004. What I want is to click a thumbnail image, which in turn will open up a new window with a larger version.<br />I have sort of worked out how to do this using the behaviours tab but for some reason after testing, whenever I select the thumbnail I get the new window with the larger image, but also the 'home page' also displays the new image too!<br />Now I am new to Dreamweaver so I suspect I have made a stupid mistake somewhere but I can't work out where!<!--content-->
if you want it just to open a new window then uses this<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><a href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"image_here.jpg" target="_blank">http://www.huddletogether.com/projects/lightbox2/<!--content-->
Hi<br /><br />If you wish to control the size of the window i have a code snippet for it target="_blank">http://www.justfigures.co.uk/javascriptextras.php<br />under snippet number 4.<br />Quote from that page:<br />"Calling a function from a hyperlink to open a new window using the 'onClick' event.<br />Overriding the default action of the link with 'return false'.<br />Placing the 'url' in the link to allow action to degrade gracefully if JavaScript is turned off."<br />The code is:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><!-- Place in the head of the page. --><br /><br /><script language="JavaScript" type="text/javascript"><br /><!-- begin<br />// function to open a new window<br />function winOpen() {<br />    window.open('1_functionLink.php','_blank','toolbar=0,scrollbars=1,location=0,statusbar=1<br />,menubar=0,resizable=1,width=20<br />,height=100')<br />}<br />// end --><br /></script><br /><br /><!-- Place in the body of the page. --><br /><br /><!-- call function from a link using the 'onClick' event <br />note placing the 'url' in the link to allow action to degrade<br />gracefully if JavaScript is turned off --><br /><a href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"1_functionLink.php" target="_blank" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
True, but your way won't work with Javascript turned off. <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/tongue.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tongue.gif" /><br /><br />I think opening new windows is like skinning a cat - there's more than style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br /><br />As for skinning cats not around here please.<!--content-->
I think target was probably deprecated because of the usability aspect. If visitors don't realise you've opened a new window, they're going to wonder why their "back" button isn't working. And what with modern browsers today (read: FF2 and IE7) all you have to do is right-click and "open in new tab". That gives users the *choice* of where to open links.<br /><br />*hugs Dizi* I didn't think you were digging at me.<!--content-->
ok for style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" /> could call that my stupidity tho.<br /><br /><br />So it is known as a safety measure for all those like me that expect some things to be open in a new window, forgot where the back button is or are scared of it. Its just been done for so long it is thought of as normal in sites...<!--content-->
Dizi - cite your source please? I am very very skeptical...<!--content-->
how would you like them cite, I am ok at the Harvard system but nothing else...<br /><br />but much like anything with the web it is personal preference, I would rather a outside link open in a new window you would rather use your back button to get back to the other site. So really I think its up to Olly1 how their site is designed and which style="vertical-align:middle" emoid=":p" border="0" alt="tongue.gif" /><!--content-->
Cite your source as in show me some evidence as to why opening links in new windows is good and why web users expect links to open in new windows.<br /><br />http://www.useit.com/alertbox/990530.html<br />http://www.sitepoint.com/article/beware-op...inks-new-window<br />http://diveintoaccessibility.org/day_16_no...ew_windows.html<br />http://www.webcredible.co.uk/user-friendly...r-windows.shtml<br /><br />But like you said, it's down to the individual to choose what they want to do... I'm just trying to offer up some things to think about.<!--content-->
you can also use Lightbox which i've found to be lovely little script thats very easy to use <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><br /><br />So here is a nice clean thread with a nice poll to get others opinions and we can go blue in the face there: <br /><br />http://www.webdesignerforum.co.uk/index.ph...ic=2134&hl=<!--content-->
Didnt read the middle of this thread properly the first time, have to say I agree with Dizi. If I open an external link from your site, once I'm done I will close that window, if it aint in a new window then I will unknowingly be closing your site too.<!--content-->
 
Top