Jquery ile ufak bi uygulama yaptım işine yarar büyük ihtimal ile
Anlatım
Not: Jquery kütüphanesini dahil etmeyi unutmayınız. Eğer sitenizde dahil edilmiş ise 2. key dahil etmeyiniz.
header_include şablonunda en alta yapıştır:
Seçim kutusunu anasayfayada istediğin herhangi bir yere koyabilirsin :
Anlatım
Not: Jquery kütüphanesini dahil etmeyi unutmayınız. Eğer sitenizde dahil edilmiş ise 2. key dahil etmeyiniz.
header_include şablonunda en alta yapıştır:
Kod:
<script type="text/javascript">
$(document).ready(function(){
$.SetCookie = function(cname,cvalue,exdays){
var d = new Date();
d.setTime(d.getTime()+(exdays*24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
$.ReadCookie = function(name){
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0){
offset = document.cookie.indexOf(search);
if (offset != -1){
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end));
}
}
$("body").animate({ width: cookieValue + "%" }, 500 );
}
$.ChangeWidth = function(){
var value = $("#WidthChanger").val();
$.SetCookie("ForumWidth",value,"999999999");
$.ReadCookie("ForumWidth");
}
$.DefaultWidth = function(name){
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0){
offset = document.cookie.indexOf(search);
if (offset != -1){
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end));
}
}
$("body").css({ "width" : cookieValue + "%" });
}
$.DefaultWidth('ForumWidth');
});
</script>
Seçim kutusunu anasayfayada istediğin herhangi bir yere koyabilirsin :
Kod:
<select id="WidthChanger" onchange="$.ChangeWidth()">
<option value="100" selected="selected">%100</option>
<option value="90">%90</option>
<option value="80">%80</option>
<option value="60">%60</option>
<option value="50">%50</option>
</select>