Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can only guess at this, as I can't see the code involved in the functions you are using here. Generally, when I use a function call and do not want any change to the page that it is called from, I will simply add 'return false;' as the last line of the function.</p> <p>However, if you have data that you want returned from the function, then you may need to place the values the function returns in a globally declared variables before you return false from the function. As an example, in your functions shown...</p> <pre><code>function MM_swapImgRestore() { ...do my processing here; my_global_variable_1 = (value you want returned from this function) return false; } functionMM_swapImage('cart','','cart-rollover.png',1) { ...do my processing here; my_global_variable_2 = (value you want returned from this function) return false; } </code></pre> <p>For an anchor tag, you can do the same thing as such...</p> <pre><code>&lt;a href="javascript:return false;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('cart','','cart-rollover.png',1)"&gt; &lt;img onclick="document.getElementById('addedcartbg').style.display='block'" src="cart.png" width="200" height="80" id="cart" /&gt; &lt;/a&gt; </code></pre> <p>Further, I would add the onclick event to the anchor instead of the image, even though HTML5 allows javascript handlers on ALL tags.</p> <pre><code>&lt;a href="javascript:return false;" onclick="document.getElementById('addedcartbg').style.display='block'" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('cart','','cart-rollover.png',1)"&gt; &lt;img src="cart.png" width="200" height="80" id="cart" /&gt; &lt;/a&gt; </code></pre> <p>Here is an example I put up for you at jsfiddle</p> <p><a href="http://jsfiddle.net/Ephiphany/bRF7t/" rel="nofollow">http://jsfiddle.net/Ephiphany/bRF7t/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload