原帖由 freddy 于 2005-9-8 21:17 发表
第一个不成功..改了后居然没反应...
你在common.js里加
- function toggle_collapse(objname) {
- obj = findobj(objname);
- img = findobj(objname+"_img");
- collapsed = getcookie("discuz_collapse");
- cookie_start = collapsed ? collapsed.indexOf(objname) : -1;
- cookie_end = cookie_start + objname.length + 1;
- if(obj.style.display == "none") {
- obj.style.display = "";
- img_re = new RegExp("_yes\\.gif$");
- img.src = img.src.replace(img_re, '_no.gif');
- if(cookie_start != -1) collapsed = collapsed.substring(0, cookie_start) + collapsed.substring(cookie_end, collapsed.length);
- } else {
- obj.style.display = "none";
- img_re = new RegExp("_no\\.gif$");
- img.src = img.src.replace(img_re, '_yes.gif');
- if(cookie_start == -1) collapsed = collapsed + objname + " ";
- }
- expires = new Date();
- expires.setTime(expires.getTime() + (collapsed ? 86400 * 30 : -(86400 * 30 * 1000)));
- document.cookie = "discuz_collapse=" + escape(collapsed) + "; expires=" + expires.toGMTString() + "; path=/";
- }
- function imgzoom(o){
- if(event.ctrlKey) {
- var zoom = parseInt(o.style.zoom, 10) || 100;
- zoom -= event.wheelDelta / 12;
- if(zoom > 0) {
- o.style.zoom = zoom + '%';
- }
- return false;
- } else {
- return true;
- }
- }
- function getcookie(name) {
- var cookie_start = document.cookie.indexOf(name);
- var cookie_end = document.cookie.indexOf(";", cookie_start);
- return cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)));
- }
复制代码
试试 |