Skip to content

Instantly share code, notes, and snippets.

@pattonjp
Created June 11, 2012 22:23
Show Gist options
  • Save pattonjp/2913113 to your computer and use it in GitHub Desktop.
Save pattonjp/2913113 to your computer and use it in GitHub Desktop.
trying to find img with certain "src" changes to "object Object" as "src"
$ = window.HS.jQuery
class Move
constructor: (@config) ->
@item = @config.item
@el = $(@item.eid)
@ella = $(@item.id)
@image = $(@item.data.imageUrl)
@clickX = $(@item.data.clickX)
@clickY = $(@item.data.clickY)
hide: ->
$("#hsModal").hide()
@el.hide()
show: ->
modalIndex = $("#hsModalOverlay").css("z-index")
@targetImage = $("img[src='#{@item.data.imageUrl}']")
$("#hsModalOverlay").css
display: 'block'
opacity: '1'
@targetImage.css
position: 'relative'
'z-index': modalIndex + 10
@targetImage.click click
click: (e)=>
targetImageOffset = @targetImage.offset()
targetImageIndex = @targetImage.css("z-index")
x = e.pageX - targetImageOffset.left
y = e.pageY - targetImageOffset.top
@item.data.clickX = x
@item.data.clickY = y
@item.render()
$("#hsModal").hide
window.HotSpots.Move = Move
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment