Skip to content

Instantly share code, notes, and snippets.

@procload
Created August 31, 2012 15:19
Show Gist options
  • Save procload/3554440 to your computer and use it in GitHub Desktop.
Save procload/3554440 to your computer and use it in GitHub Desktop.
# call jRespond and add breakpoints
jRes = jRespond([
label: "handheld"
enter: 0
exit: 768
,
label: "tablet"
enter: 768
exit: 939
,
label: "desktop"
enter: 940
exit: 10000
])
jRes.addFunc
breakpoint: "handheld"
enter: ->
$(".divisions .division .img-head h4").click ->
$(this).toggleClass('expanded')
$(this).parent('.img-head').siblings('.division-body').slideToggle "fast"
exit: ->
$(".divisions .division .division-body").show()
$(".divisions .division .img-head h4").unbind "click"
jRes.addFunc
breakpoint: ["tablet","desktop"]
enter: ->
$(".divisions .division").hover ->
$(this).children('.hover-state').show()
$(this).children('.screen:visible').hide()
$(this).siblings('.division').children('.screen:hidden').show()
$(this).siblings('.division').children('.hover-state').hide()
$('.divisions').mouseleave ->
$('.divisions .division .hover-state').hide()
$('.divisions .division .screen:visible').hide()
exit: ->
$(".divisions .division").unbind "hover"
$(".divisions").unbind "mouseleave"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment