Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery () ->
- $("#switch a").click (e) ->
- e.preventDefault()
- $(this).tab("show")
- $("#switch_license").click (e) ->
- e.preventDefault()
- $(this).tab("show")
- $(".slider").cycle({pager: ".slider-nav"});
- closeAlert()
- previewImage()
- $(".tab-pane").on("click", ".free", (event) ->
- event.preventDefault()
- $("#ask_email_modal").find("form").prop("action", $(event.target).data("down-url"))
- $("#ask_email_modal").modal("show")
- )
- closeAlert = () ->
- $(".close").click () ->
- $(".subscribe *").fadeOut(300, ()->
- $(".subscribe").animate({"height":25},300,() ->
- $(".subscribe").addClass("subscribe-no-txt")
- )
- )
- previewImage = () ->
- $(".tab-pane").on("mouseenter", "img", (event) ->
- $(event.target).on("mousemove", (move_event) ->
- preview = $(move_event.target).parents(".image_container").find(".preview")
- preview.removeClass("hide").fadeIn(200).addClass("show")
- winH = parseInt($(window).height())
- triangleY = (move_event.screenY / winH) * 316
- triangleY = 0 if triangleY < 0
- $(".triangle").css("top", "#{triangleY}px")
- triangleT = parseInt($(preview).find(".triangle").css("top"))
- winW = parseInt($(window).width()) / 2
- winH = parseInt($(window).height()) / 2
- if move_event.screenX > winW + 167/2
- preview.css("left", "#{(move_event.pageX) - preview.width() - 70}px")
- $(".triangle").removeClass("left").addClass("right")
- else
- preview.css("left", "#{(move_event.pageX) + 40}px")
- $(".triangle").removeClass("right").addClass("left")
- preview.css("top", "#{(move_event.pageY) - triangleT - 20}px")
- )
- )
- $(".tab-pane").on("mouseleave", "img", (event) ->
- $(event.target).off("mousemove")
- $(".preview").removeClass("show").addClass("hide").hide()
- $(".preview").hide()
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement