Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready ->
- control.init()
- return
- control =
- init: ->
- c = this
- c.slider()
- c.dropdown_province()
- c.tab_journey()
- return
- slider: ->
- $('.flexslider').flexslider
- animation: 'slide'
- easing: 'swing'
- slideshowSpeed: 4000
- return
- dropdown_province: ->
- focusTextbox = null
- dropdown = $('.dropdown-province')
- $('.province').focus ->
- focusTextbox = $(this)
- position = focusTextbox.position()
- dropdown.css('top', position.top + 28).css('left', position.left).fadeIn 500
- return
- $('.dropdown-province .btn-close').on 'click', (event) ->
- dropdown.hide()
- return
- $('.dropdown-province a').on 'click', (event) ->
- event.preventDefault()
- province = $(this).text()
- focusTextbox.val province
- dropdown.hide()
- return
- return
- tab_journey: ->
- $('.tabs a').on 'click', (event) ->
- event.preventDefault()
- parent = $(this).parent()
- parent.addClass 'active'
- parent.siblings().removeClass 'active'
- tab = $(this).attr('href')
- idContent = $(this).closest('ul').data('target')
- contents = $('#' + idContent)
- contents.children('.content').not(tab).css 'display', 'none'
- contents.find(tab).fadeIn()
- return
- return
- # ---
- # generated by js2coffee 2.0.0
Advertisement
Add Comment
Please, Sign In to add comment