PDA

View Full Version : mouse icon change - open in new browser window


Don_P
05-07-2008, 10:46 AM
Anyone tell me how to get the mouse icon to change when i set the open in new browser window option for an image. It all works, just there is no indication wiht the mouse icon that it is a link to something else.


Cheers

Rob_Che
05-07-2008, 11:19 AM
On the drop down menu for the 'onclick' command there is another 'onclick' command lower down... maybe "onclick" in quotes or something...

It's been a while since I used it !

Rob

Don_P
05-07-2008, 11:24 AM
only other options i got are <A> and the following behaviour - but i get an error message each time i try to apply those options. Maybe I could manually type in the behaviour if someone knew it?

Rob_Che
05-07-2008, 11:46 AM
It's shown in the drop down menu in brackets... see here:
http://www.dwfaq.com/Tutorials/DW-Interface/behavior_events.asp

Don_P
05-07-2008, 12:34 PM
I dont have a problem applying the behaviour, the new browser window loads fine. It is if you hover over the image with the mouse, then there is no indication by the mouse cursor changing to the hand icon that it is a link. It just has the same normal arrow icon.

The link you sent showed me how to change behaviour event. Also, is strange - I looked for every browser - still got no option of (onclick) - has it changed in cs3?

Rob_Che
05-07-2008, 01:08 PM
When you go to your behaviours docker does it have a drop down like this?:
http://www.dwfaq.com/images/dan/behavior_panel/screenshot4.gif

if so... it's the 'onclick' in brackets you need - this will give you the finger. *cough*

First, select the image you've applied the behavior to and open your Behaviors panel. You should notice that the event is applied onMouseDown. Click on the Action to activate it and then click the arrow to show the drop down menu.
This time, your list should be much longer. Notice the difference between the top set of events and the bottom set of events. Events without parentheses are attached to the image itself. Events with parentheses will be attached to the <a> tag wrapping your image. In order to get your popup windows working in Netscape you need to change your event to (onClick). This will wrap your image with the <a> tag and apply the event onClick.

Hope that helps...
Rob

domedia
05-07-2008, 01:15 PM
Make a link first, then apply the onClick behavior. Make sure you set 'return false' to the javascript generated to disable the link in the href attribute, or else it will open a new page and a pop-up window ;)

m1a2x3x7
05-07-2008, 04:54 PM
you can add a css style to it.

.style name
{
cursor: pointer;
}

domedia
05-07-2008, 07:00 PM
That would work too. Remember those suckers that don't have javascript in/enabled in their browser though.

mek113
07-09-2008, 02:56 AM
I would like to revisit this query. I had this same problem and was able to resolve it using the suggestion to add a style to the image. Sorry, domedia, I didn't follow your direction about setting the 'return false' in the javascript. Is that hand-coding that needs to be done or something that can be done in DW? I don't know javascript unless DW does it for me.

My real question however is how do I Open a New Browser onClick for a .pdf document and get the link to rollover to the "finger"? I can't think how I would set a css style for that.

mek113

Corrosive
07-09-2008, 06:10 AM
Just apply this style to whatever you want the hand to show up on...

cursor: hand;

In DW it's under 'Extensions, Visual Effect and then Cursor'

Hope this helps.

Cheers

mek113
07-10-2008, 01:33 AM
Sorry, I'm not following you. Am I setting the style for the cursor: hand on the a:link? Maybe it would be easier to show you the website link:
http://www.pikecountyfair.org/schedule.html I'm wanting all of the "more info" links to just open up a window to display the pdf.

mek113

Corrosive
07-10-2008, 03:16 PM
Sorry, I'm not following you. Am I setting the style for the cursor: hand on the a:link? Maybe it would be easier to show you the website link:
http://www.pikecountyfair.org/schedule.html I'm wanting all of the "more info" links to just open up a window to display the pdf.

mek113

Hi Mek

What I got from your post was that you wanted to use the server behaviour 'open pop up window' when the image link is clicked. What you also need is to have the cursor change to a hand when the image is hovered over so that people know that it is a link and not just an image. Am I correct?

If so, you can use CSS to style the layer or div containing the image as I suggested in my last post

cursor: hand;

This means that when the picture is hovered over it will become a hand icon and then when the image is clicked the behaviour kicks in and opens your pop up window.

Personally I hate pop up windows littering my screen and I would stick to just standard links into the PDFs. Your viewers can just use the browser 'back' button to return to the front page. It's your choice though.

mek113
07-10-2008, 04:03 PM
I agree with using the browser back button but there have been many times myself that I quickly click that red X button in the upper right hand corner and close out the browser completely and then I'm not happy either.

I did finally accomplish what I needed to do but only because I borrowed the javascript code from another website. So far anyone else that is having a problem with double browser windows opening when using this behavior and/or the link not showing with the active hand, here is what I did. Probably not the best solution.

Here is the code that DW generated when I added a Behavior > Open New Browser window. Then enter the file to link to, size, etc. The javascript code that is generated for an onClick action is:
<a href="events/gospelmusic.pdf" onClick="MM_openBrWindow('events/gospelmusic.pdf','events','width=600,height=400')">more info</a>

Delete the .pdf link information and change onClick to javascript:

See below for the final code using my own link information:
<a href="javascript:MM_openBrWindow('events/gospelmusic.pdf','events','width=600,height=400')">more info</a>

Everything in the a href now shows up in the link information in the Properties section of DW and it appears as a rollover link like we originally wanted plus opens only one new browser window the size that you want it.

mek113

Corrosive
07-10-2008, 04:20 PM
I agree with using the browser back button but there have been many times myself that I quickly click that red X button in the upper right hand corner and close out the browser completely and then I'm not happy either.

I did finally accomplish what I needed to do but only because I borrowed the javascript code from another website. So far anyone else that is having a problem with double browser windows opening when using this behavior and/or the link not showing with the active hand, here is what I did. Probably not the best solution.

Here is the code that DW generated when I added a Behavior > Open New Browser window. Then enter the file to link to, size, etc. The javascript code that is generated for an onClick action is:
<a href="events/gospelmusic.pdf" onClick="MM_openBrWindow('events/gospelmusic.pdf','events','width=600,height=400')">more info</a>

Delete the .pdf link information and change onClick to javascript:

See below for the final code using my own link information:
<a href="javascript:MM_openBrWindow('events/gospelmusic.pdf','events','width=600,height=400')">more info</a>

Everything in the a href now shows up in the link information in the Properties section of DW and it appears as a rollover link like we originally wanted plus opens only one new browser window the size that you want it.

mek113

Nice one Mek. Sounds like you've got it all sewn up. :)