"Responsive Jquery" If width add div link else remove div link
I have this code that turns a div into a link when the screen is sized to a specific width. How do I get it to remove the link when the width is larger?
- $(window).resize(function(){
- if ($(window).width() <= 768) {
- $(".discussionListItem .main, .nodeList .nodeInfo, .memberList .memberListItem").click(function(){
- window.location=$(this).find("a").attr("href");
- return false;
- });
- } else if ($(window).width() >= 769) {
- $(".discussionListItem .main a, .nodeList .nodeInfo a, .memberList .memberListItem a").removeAttr('href');
- }
- });