Liekam mājaslapas augšā - Top part ...
Code
<script type="text/javascript">
function setCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else var expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
function eraseCookie(name) {
setCookie(name, "", -1);
};
</script>
Bet matereālu izskata pašās beigās
Code
<script type="text/javascript">
if(getCookie('wCookieLook$ID$')) {
$(".wProcmotrno$ID$").after('<div style="background:#000; padding:4px 6px; width:100px; font-size:12px; color:#fff; text-transform:uppercase; position:absolute; top:-24px; left:230px; z-index:9999;" align="center">Apskatīts</div>');
}
$(".wProcmotrno$ID$").click(function(){setCookie('wCookieLook$ID$', 1, 365);});
</script>
Kā arī matereālu izskatā atrodam
<a href="$ENTRY_URL$" >$TITLE$</a> un izstājam ar
Code
<a href="$ENTRY_URL$" class="wProcmotrno$ID$">$TITLE$</a>
Iznākums