Jump to content

Buttons as full images


Guest jpmad4it

Recommended Posts

Well, you are right, that is very tricky now that I look at it. I would have to really hack it up to get the js in there.

First, you would assign id manually for each link. You can find each link defined individually in this file.

Second, to add javascript to the links is a bit tricky. I really can't go innto all the explanation here, but to really hack it in, you would do like this:

'link' => "cart.php?act=".treatGet($_GET['act'])."&mode=emptyCart\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('link')",

In the page source code, the link then generated should look like this:

<a href="cart.php?act=step1&mode=emptyCart" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('link')">

Link to comment
Share on other sites

Guest jpmad4it

Well, you are right, that is very tricky now that I look at it. I would have to really hack it up to get the js in there.

First, you would assign id manually for each link. You can find each link defined individually in this file.

Second, to add javascript to the links is a bit tricky. I really can't go innto all the explanation here, but to really hack it in, you would do like this:

'link' => "cart.php?act=".treatGet($_GET['act'])."&amp;mode=emptyCart\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('link')",

In the page source code, the link then generated should look like this:

<a href="cart.php?act=step1&mode=emptyCart" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('link')">

Thats weird :)

I added the link like you said and uploaded the file, but the link never changed. It just remained as:

http://www.mysite.com/upload/cart.php?act=step2&mode=emptyCart

I think I might just leave the buttons as static images and forget about the Javascript mouseover part, because if you say that its tricky I'm not going to have much chance getting it right!!

Link to comment
Share on other sites

Guest jpmad4it

If I add that Javascript to the link, won't that be useless as the javascript will only be executed when the mouse button is pressed??

EDIT : forget that, I just realised that I'm wrong :(

Link to comment
Share on other sites

Guest jpmad4it

hey I did it! That was quite easy! It just clicked :-)

The one I am struggling with is where the link ends with a bracket like this one for 'previous page':

str_replace("&","&amp;",$_SERVER['HTTP_REFERER']),




EDIT: I have done it like this:




str_replace("&","&amp;",$_SERVER['HTTP_REFERER'])."\" onmouseout=\"MM_swapImgRestore()\"  etc etc etc.

It seems to work - I think it correct?

Link to comment
Share on other sites

yes - and you're doing a damned good job of guessing :(

the period . concatenates your variable $_SERVER['HTTP_REFERER'] to the text string you need to type in, and since it is text string it gets the quote mark, so ." after the variable is beautiful. The other quote marks are escaped \" as they should be. Great job, and I am thrilled you figured it all out :D

Link to comment
Share on other sites

Guest jpmad4it

yes - and you're doing a damned good job of guessing :(

the period . concatenates your variable $_SERVER['HTTP_REFERER'] to the text string you need to type in, and since it is text string it gets the quote mark, so ." after the variable is beautiful. The other quote marks are escaped \" as they should be. Great job, and I am thrilled you figured it all out :D

Thanks :)

I wouldn't have been able to do it without your fantastic help! So thank you very much !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...