It does not really have to do with Modx beside it's build in Modx.
My js skills are not that great and I'm struggling with some coding.
I need to hide a div when reaching a viewport < 767
Clicking on a other div shows it again.
I made a fiddle:
http://jsfiddle.net/4URNe/1/
There are still some things which doesn't work.
The show button doesn't work, when loading the page < 767 it still shows, after smallen or extend just 1px then it disapears and I don't know how to let it work for blok2.
The script I have atm:
$(window).resize(function() {
if ($(window).width() < 767) {$(".blok1").hide()}
else{$(".blok1").show()}
});
function showMe(){
jQuery(".blok1").show();
}
function showMe2(){
jQuery(".blok2").show();
}
The html:
<div class="bull bull-blok1"><a class="show-blok1" href="javascript:showMe()">Show</a></div>
<div class="bull bull-blok2"><a class="show-blok1" href="javascript:showMe2()">Show</a></div>
<div class="blokken blok1">
<div class="text"><div class="padx"><p>Lorem ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here.</p></div></div>
</div>
<div class="blokken blok2">
<div class="text"><div class="padx"><p>Lorem ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here, ipsum here.</p></div></div>
</div>