Created
January 30, 2012 20:28
-
-
Save mitchellhislop/1706474 to your computer and use it in GitHub Desktop.
SimpleModal Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('.ssa_button').click(function(event){ | |
if (console.log) | |
{ | |
console.log('in click handler with ' + $(this).data('vid-id')); | |
} | |
//stop the bubble and prop | |
event.preventDefault(); | |
//cache the jQ object | |
var frame = $('#vid_frame'); | |
src = $(this).data('url'); | |
adHeight = $(this).data('height'); | |
adWidth = $(this).data('width'); | |
frame.attr('height', adHeight); | |
frame.attr('width', adWidth); | |
frame.attr('src', src); | |
frame.modal({ | |
opacity:80, | |
overlayCss: {background:"#fff"}, | |
onClose: function(dialog) { | |
$.modal.close(); | |
//OPT 1 - just reloads the page, letting the API do the rest | |
window.location = window.location; | |
//OPT 2 - pops the info for the next video | |
//var nextVid = vid_obj[1]; | |
//console.log(nextVid); | |
//src = nextVid.url; | |
//adHeight = nextVid.height; | |
//adWidth = nextVid.width; | |
//$('.ssa_button').attr('data-height', adHeight); | |
//$('.ssa_button').attr('data-width', adWidth); | |
//$('.ssa_button').attr('data-url' , src); | |
//$('.ssa_button').attr('data-vid-id', nextVid.offerId); | |
//$('.ssa_button').attr('id', 'ssa_button_'+nextVid.offerId); | |
//return true; | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment