Page 1 of 1

HTML rollover code gets kicked out

Posted: Sat May 02, 2020 2:16 pm
by genestevo
Hi Guys, I'm trying to add a simple rollover to a button on this page:
https://historypoints.org/index.php?pag ... ay-station
The current code works perfectly as per:

Code: Select all

<div style="float: left; margin-right: 15px;"><a href="{cms_selflink href='railway-history'}"> <img src="uploads/images/rollovers/sign-out.gif" alt="sign-out" width="120" height="60" /> </a></div>
However, when I add the rollover instructions it gets kicked out immediatley when I go back to regular view. As per:

Code: Select all

<!--rolloverBeggins-->
<div style="float: left; margin-right: 15px;"><a href="{cms_selflink href='railway-history'}"> <img src="uploads/images/rollovers/sign-out.gif" alt="sign-out" width="120" height="60" 
onmouseover=”this.src=’uploads/images/rollovers/sign-over.gif ’ ” alt="sign-over" width="120" height="60"
onmouseout=”this.src=’uploads/images/rollovers/sign-out.gif ’ ” alt="sign-out" width="120" height="60"/> </a></div>
<!--rolloverEnds-->
I chose this way as it is the most simple, for the benefit of another (and myself if I'm honest). Am i doing something wrong with my code or should I go the CSS route.
Cheers and best wishes,
Eugene.

Re: HTML rollover code gets kicked out

Posted: Sat May 02, 2020 3:29 pm
by DIGI3
I'm not sure what the terms "kicked out" and "regular view" mean, could you elaborate?

If I were to take a guess perhaps you mean that the wysiwyg editor is stripping out your code? If that's the case, I would recommend disabling it for that content block, or using one that lets you specify what it strips/doesn't strip.

But yes, just giving it an id/class and doing the rollover in css or non-inline js would probably be better regardless.

Re: HTML rollover code gets kicked out

Posted: Sun May 03, 2020 10:16 am
by genestevo
Tried disabling WYSIWYG editor, cleared browser and system cache. No joy. Either something wrong with my syntax, code in general or the way I hold my face. Will take advice and re-work in CSS (though it turns out rollover “…not that important really”).
Just goes to show, a little knowledge is never enough. Thanks again. I’ll mark this as solved.