markscarts Posted April 28, 2007 Share Posted April 28, 2007 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')"> Quote Link to comment Share on other sites More sharing options...
Guest jpmad4it Posted May 1, 2007 Share Posted May 1, 2007 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')"> 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!! Quote Link to comment Share on other sites More sharing options...
Guest jpmad4it Posted May 2, 2007 Share Posted May 2, 2007 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 :( Quote Link to comment Share on other sites More sharing options...
Guest jpmad4it Posted May 2, 2007 Share Posted May 2, 2007 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("&","&",$_SERVER['HTTP_REFERER']), EDIT: I have done it like this: str_replace("&","&",$_SERVER['HTTP_REFERER'])."\" onmouseout=\"MM_swapImgRestore()\" etc etc etc. It seems to work - I think it correct? Quote Link to comment Share on other sites More sharing options...
markscarts Posted May 2, 2007 Share Posted May 2, 2007 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 Quote Link to comment Share on other sites More sharing options...
Guest jpmad4it Posted May 3, 2007 Share Posted May 3, 2007 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 Thanks I wouldn't have been able to do it without your fantastic help! So thank you very much ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.