How Can I Put This Image https://2img.net/i/fa/m/tabs_less1.gif On The Right Corner Of Mine Caggorie

View previous topic View next topic Go down

avatar
BadlyHacked2
Banned
Banned
Forum Posts : 8
Member Since : 2011-12-19
http://www.badhaxer.com

PostBadlyHacked2 2/1/2012, 3:38 pm

Ok my friend wants this on my site and i want to do it to how can i put this image https://2img.net/i/fa/m/tabs_less1.gif on the right corner on the Categories cause when i do it i get confused can someone help me.

Forum Version: PunBB
Mike
Mike
Administrator
Forum Posts : 446
Member Since : 2011-10-28
http://www.codinghelp.org

PostMike 2/1/2012, 3:46 pm

Add this to JS management and enable it for all pages...

Code:
function toggleLTcategory(cat) {
    var cid=cat.id;
    var button=document.getElementById('b'+cid);
    if (cat.style.display=='none') {
        cat.style.display='block';
        button.className='contract';
        my_setcookie('_' + cid, '', true);
    }
    else {
        cat.style.display='none';
        button.className='expand';
        my_setcookie('_' + cid, '1', true);
    }
}
 
jQuery(function () {
    x=jQuery('.main-head .page-title').get();
    for (i=0; i<x.length; i++) {
        x[i].style.position='relative';
        var cid='c'+String(i+1);
        x[i].parentNode.nextSibling.setAttribute('id',cid);
        x[i].parentNode.nextSibling.style.display='block';
        var y='<div id="b'+cid+'" class="contract" onclick="toggleLTcategory(this.parentNode.parentNode.nextSibling);"></div>';
        x[i].innerHTML=x[i].innerHTML+y;
    }
 
    cookies = documentcookie.split('; ');
    for (i in cookies) {
        if (cookies[i].charAt(0) == '_') {
            cookie = cookies[i].split('=');
            if (cookie[1] == '1') {
                cid = cookie[0].substring(1);
                if (document.getElementById(cid)) {toggleLTcategory(cid);}
            }
        }
    }
});

then add this to css:

Code:
.expand, .contract {position: absolute; top: 6px; right: 10px; cursor: pointer; width: 9px; height: 9px; background: url(http://2img.net/i/fa/m/tabs_more1.gif);}
.contract {background: url(http://2img.net/i/fa/m/tabs_less1.gif);}
avatar
BadlyHacked2
Banned
Banned
Forum Posts : 8
Member Since : 2011-12-19
http://www.badhaxer.com

PostBadlyHacked2 2/1/2012, 3:48 pm

Thanks Bro
Cody
Cody
Member
Member
Forum Posts : 43
Member Since : 2011-11-13

PostCody 2/1/2012, 3:53 pm

Marked Solved & Locked
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum