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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Browser Window Behavior Issue 1

Status
Not open for further replies.

lescal

Technical User
Aug 24, 2001
2
US
I attached the Open Browser Window behavior to a thumbnail photo directing it to open a linked page in a new window to show a larger photo and description. This works fine using the default onMouseover event. I altered the event from onMouseover to onClick. Upon clicking the new window opens fine, but the original browser window (with the thumbnail photos) also loads the page being loaded into the new window (in IE4 and NS4.75). Any suggestions on how to make it refrain from loading it into the original window as well?
 
Hey Lescal,

I dont have an answer for your question (sorry) but maybe you can answer 1 for me.

How did you change the behavior to on click?


Thank you,
FZ
 
Hello all!

To lescal,

To be honest I love DW but some thing I have to do manually.
When you use Open New Window behaviour with link (<A>) DW attaches it as &quot;onClick=&quot; (&quot;onOver=&quot; or any other) event. And the code looks like:
<a href=&quot;#&quot; onClick=&quot;MM_openBrWindow()&quot;>

I usually change it to look like this:
<a href=&quot;JavaScript:MM_openBrWindow()&quot;>

The main idea to change it is that in first case browser opens new window but content of first browser goes up (because of # sign) but in second case content stays in one place.

If changing something manually is difficult for you do this:
1) open Behaviours window (Window > Behaviours);
2) click on + sign and in the bottom of drop down menu select &quot;Show Events For&quot;;
3) select &quot;4.0 and Later Browsers&quot;.
In this case DW will use onClick event by default.



To FreddieZed,

It's very easy:
1) open Behaviour window (Window > Behaviours);
2) select disared behaviour (in Behaviours window you'll see some behaviours you added before, click on it);
3) select disared event in Events drop down menu (again in Behavouirs window you'll see Events and Actions, Events have drop down menu with all possible events for selected browser).

Note: DW shows only behaviours for selected browsers. Click on plus sign + and in the bottom you'll see &quot;Show Events For&quot;. Select browser you need.


Good Luck!
 
Most excellent tip - set me on the right track. I had been reluctant to interfere with the DW JavaScript code until I became more familiar with how much tinkering it will tolerate. I am accustomed to using &quot;javascript:void(0)&quot; instead of the &quot;#&quot; as I was taught that was better for security reasons. I see DW uses a variation on that with the onClick for v4 and up browswers. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top