简体   繁体   中英

JS change cursor to a hand pointer

Hi there I have the following menu built (by a previous employee) please go to the following site: http://www.astroflame.com .

Now I am sort of newish to JS and wondered if its possible to change the cursor to a hand pointer (instead of an arrow). Now the menu is built from I can see using 2 x js files named menu.js and stm31.js. can anyone help? thanks!

You can select the element and set the cursor to pointer:

    var element = document.getElementById("$menu_item");
    element.style.cursor = "pointer";

Hi there thanks for your help, but I found out what i was looking for it was a simple change in the STM31 js file that was styling the the menu:

function getcursor(it) { if(nNN6) return "pointer"; return it.type!="sepline"&&((it.mbi==0&&getme(it).click_sh&&getsub(it))||it.url!="") ? "hand" : "default"; }

the return code was set to "default" so this was changed to "pointer". Just to point out the menu js file is mainly being used to display the menu drop down text.

again thanks for your time and help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM