Posts: 4
Threads: 2
Joined: May 2013
2013-06-18, 03:05:55
(This post was last modified: 2013-06-18, 03:10:13 by pan.)
Why by editing page in <>source section after clicking on "Save Updates" my code disappear? That what I have changed is visible on website but when I back to "edit page" I can't see a code I put few seconds ago. Why?
Sorry for my english.
Posts: 6,267
Threads: 182
Joined: Sep 2011
What "code" are you putting in?
Sounds like a cache issue.
Posts: 4
Threads: 2
Joined: May 2013
HTML part disappear
HTML
PHP Code:
<a href="#" class="greenhead"
onclick="style.background='url(http://i.cubeupload.com/Gi4rVR.png) ' "></a>
CSS
PHP Code:
.greenhead {
width: 200px;
height: 200px;
display: block;
border: 0px;
background: url('http://i.cubeupload.com/TYeudm.png');
}
.greenhead:hover {
background: url('http://i.cubeupload.com/lYu4hD.png');
}
Posts: 6,267
Threads: 182
Joined: Sep 2011
your link is empty, ckeditor will remove empty tags.
Posts: 4
Threads: 2
Joined: May 2013
What you mean "empty"? You mean:
1)
<a href="
this" class="greenhead"
onclick="style.background='url(http://i.cubeupload.com/Gi4rVR.png) ' "></a>
or
2)
<a href="#" class="greenhead"
onclick="style.background='url(http://i.cubeupload.com/Gi4rVR.png) ' ">
this</a>
when i put link insted of hash than mr. greenface display on site but code disappear, exactly as before.
If you mean a second case. I have a lil bit similar code like this one, without css only html:
PHP Code:
<a href="http://www.get-simple.info" rel="newWindow" target="_blank"><img alt="Getsimple" height="200" onclick="this.src='http://i.cubeupload.com/Gi4rVR.png'; this.onmouseover='none'; this.onmouseout='none'" onmouseout="this.src='http://i.cubeupload.com/TYeudm.png'; " onmouseover="this.src='http://i.cubeupload.com/lYu4hD.png'; " src="http://i.cubeupload.com/TYeudm.png" width="200" /></a>
And this one don't disappear but as you see it's too long and i need shorter but I don't know what am I supposed to do.
I don't know how first code should look like.
Posts: 6,267
Threads: 182
Joined: Sep 2011
you cannot use onclick handlers on an image, it should be on the link.
Also you probably want to do all this in a js file, using listeners. Inline js is not really used anymore, also it will seperate your code from your editor nicely.