This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > Easy Javascript question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Easy Javascript question
Reesy2

2004-08-26, 12:20 pm

I have a bit of a problem with onclick javascript function.
Its on a FAQ page where when you click the question it opens the answer in a
new window.

The problem is that is also opens another copy of the current window (ie the
FAQ page)
The Behaviors read.
onClick - Open Browser Window.
This window has the relevant URL, width, height and window name

I save it, click F12... click the relevant url and viola it works.... but then
another copy of the original FAQ page also opens...

Also...
How can I centralise that new pop up window?
At the moment it opens aligned top left.

1 more if I may which is even easier but I cant seem to work it out.
How do I create the swap symbol for text alone... ie on rollover it changes
the text colour and underlines it.

Id be very greatful if someone could help this thicky out.
Cheers
James


T.Pastrana - 4Level

2004-08-26, 12:20 pm

Reesy2,

Instead of using the URL to the page in the Property Inspectors link field
type in java script:; instead. As for centering the window you can use
the Open Beowser extension on this page. It has a centering or other
positioning options too.

http://www.fourlevel.com/extensions.htm


--
Regards,
...Trent Pastrana
www.fourlevel.com

-----------------------------



"Reesy2" <webforumsuser@macromedia.com> wrote in message
news:cgh4mo$la2$1@forums.macromedia.com...
> I have a bit of a problem with onclick javascript function.
> Its on a FAQ page where when you click the question it opens the answer

in a
> new window.
>
> The problem is that is also opens another copy of the current window (ie

the
> FAQ page)
> The Behaviors read.
> onClick - Open Browser Window.
> This window has the relevant URL, width, height and window name
>
> I save it, click F12... click the relevant url and viola it works.... but

then
> another copy of the original FAQ page also opens...
>
> Also...
> How can I centralise that new pop up window?
> At the moment it opens aligned top left.
>
> 1 more if I may which is even easier but I cant seem to work it out.
> How do I create the swap symbol for text alone... ie on rollover it

changes
> the text colour and underlines it.
>
> Id be very greatful if someone could help this thicky out.
> Cheers
> James
>
>



Reesy2

2004-08-26, 12:20 pm

Hi,
Thanks for the reply.
Im not currently using the URL to the page in the Property Inspectors link
field, in there is a # and im using the javascript behaviours to do the same
thing.
The page with the options has no aligning options.
Which page are you refering to please?

Thanks again
James

T.Pastrana - 4Level

2004-08-26, 12:20 pm

Do you possibly have a link to your page online? much easier to troubleshoot
looking directly at the code.

--
Regards,
...Trent Pastrana
www.fourlevel.com

-----------------------------



"Reesy2" <webforumsuser@macromedia.com> wrote in message
news:cgh6r2$mt4$1@forums.macromedia.com...
> Hi,
> Thanks for the reply.
> Im not currently using the URL to the page in the Property Inspectors

link
> field, in there is a # and im using the javascript behaviours to do the

same
> thing.
> The page with the options has no aligning options.
> Which page are you refering to please?
>
> Thanks again
> James
>



Reesy2

2004-08-26, 12:20 pm

Hi,
Sorry no unfortunately not and im not allowed to upload one either :(

I am looking at this part of the code, could I add something here to
centralise the new pop up window on the screen at all?

<a href="#" target="_parent"
onclick="MM_openBrWindow('What%20payment%20options%20do%20you%20accept.htm','pay
mentoptions','width=550,height=200')">

Thanks,
James

T.Pastrana - 4Level

2004-08-26, 12:20 pm

Oh ok, remove the target=_"parent" from that line. That is the part of the
code that is opening the same page in the larger window.

Are you familiar with Dreamweaver extensions?

The OpenBrowser at our website is an extension. You download it and install
it into Dreamweaver. Re-boot Dreamweaver and it will become useable. There
are instructions for installing the extension at the bottom of the page of
the link I gave you.

http://www.fourlevel.com/extensions.htm

If you follow the "Help" link for the OpenBrowser extension listed on this
page ( It's the 1st entry ) There are instructions for the use of the
extension.

It basically works like the Stock MM OpenBrowser but has a few more options,
including the ability to center the window after opening it. If you have
questions after download feel free to email me at our support link.

http://www.fourlevel.com/support.htm


--
Regards,
...Trent Pastrana
www.fourlevel.com

-----------------------------





"Reesy2" <webforumsuser@macromedia.com> wrote in message
news:cghacp$ppm$1@forums.macromedia.com...
> Hi,
> Sorry no unfortunately not and im not allowed to upload one either :(
>
> I am looking at this part of the code, could I add something here to
> centralise the new pop up window on the screen at all?
>
> <a href="#" target="_parent"
>

onclick="MM_openBrWindow('What%20payment%20options%20do%20you%20accept.htm',
'pay
> mentoptions','width=550,height=200')">
>
> Thanks,
> James
>



Reesy2

2004-08-26, 12:20 pm

Are you familiar with Dreamweaver extensions?

Yes I am.

MANY THANKS!
That was EXACTLY what I was looking for!
Ive downloaded, installed and used and it works a treat!

Thanks again
James
(James is off to change the other 30 links now.... sigh)! :)

Reesy2

2004-08-26, 12:20 pm

ok so thats them all sorted :)

All I need to know now anyone please is how to create simple text rollovers.
ie like in this forum navigation.
Forums changes to Forums when rolled over.

I know how to do it for images using swap images and buttons but not text.
Anyone please?

Thanks
James

Murray *TMM*

2004-08-26, 12:20 pm

In addition to Trent's recommendation, you might want to consider this
change to your code -

<a href="What%20payment%20options%20do%20you%20accept.htm"
onclick="MM_openBrWindow('What%20payment%20options%20do%20you%20accept.htm','pay
mentoptions','width=550,height=200'); return false">

and you might consider not using spaces or mixed case in your
file/pathnames. Both of those will bite you when you least expect/need it.

The change above will allow your link to continue to function if the visitor
has javascript turned off.

> I know how to do it for images using swap images and buttons but not text.
> Anyone please?


Pseudo-classes and container styles are what you need - here are some
tutorials.
http://www.mako4css.com
http://www.thepattysite.com/linkstyles1.cfm
http://www.projectseven.com/tutoria...asses/index.htm

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Reesy2" <webforumsuser@macromedia.com> wrote in message
news:cghacp$ppm$1@forums.macromedia.com...
> Hi,
> Sorry no unfortunately not and im not allowed to upload one either :(
>
> I am looking at this part of the code, could I add something here to
> centralise the new pop up window on the screen at all?
>
> <a href="#" target="_parent"
> onclick="MM_openBrWindow('What%20payment%20options%20do%20you%20accept.htm','pay
> mentoptions','width=550,height=200')">
>
> Thanks,
> James
>



Reesy2

2004-08-26, 12:22 pm

Hi Murray,
Thanks for the help.
I have implemented your suggestions.

Thanks again
James
musicianx

2004-08-26, 12:22 pm

i'm doing something similar to what you're describing, opening an autonomous
window. here's how i got the beast to cooporate:
<a href="#" onClick="var win =
window.open('cresetpage4.htm','win','top=0,left=0,width=795,height=600');">
<img src="../graphics/chip4.GIF" alt="Title: Mistaken, Artist: musician X,
Size: 3.47Mb" width="60" height="60" border="0">
</a>

my page is "cresetpage4.htm" a neat thing to notice in the javascript above is
the use of the "win" variable
also notice i set top and left attributes which define the location of your
window when it appears. size the window using height and width

musicianx

2004-08-26, 12:22 pm

regarding your text swap i think you're looking for the page properties. this
is where you can define link colors and underline but also a rollover action
can be set there.
in "design mode" right-click you page select "page property"

if you want to use colors other than your link colors on the page properties i
would suggest creating div tags with no background attributes (for a
transparent background behind your text). create 2 divs with the same text but
different colors align the 2 divs on the same X/Y location, then make one
visible and the other hidden an your desired event like OnMouseIn or out or
OnClick. use javascript for the visibility and hidden manipulation

musicianx

2004-08-26, 12:22 pm

sorry. looks like i botched the first code sample. here's another try:
"<a href="#" onClick="var win =
window.open('cresetpage2.htm','win','top=0,left=0,width=795,height=600');">
<img src="../graphics/chip2.GIF" alt="Title: Forget About Me, Artist:
musician X, Size: 3.29Mb" width="60" height="60" border="0">
</a>"
i wrapped it in quotes this time

musicianx

2004-08-26, 12:22 pm

sorry. looks like i botched the first code sample. here's another try:
<the letter"a" href="#" onClick="var win =
window.open('cresetpage2.htm','win','top=0,left=0,width=795,height=600');">
<img src="../graphics/chip2.GIF" alt="Title: Forget About Me, Artist:
musician X, Size: 3.29Mb" width="60" height="60" border="0">
</the letter "a">"
sorry again a tag keeps getting filtered

Reesy2

2004-08-26, 12:22 pm

Hi, t
hanks for all the advice.
I think ive cracked it all now anyway.

Cheers
James
PS id recommend downloading the extension above, it works a treat and is very easy to use.
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews