Skip to content

Instantly share code, notes, and snippets.

@mitchellhislop
Created January 30, 2012 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchellhislop/1706474 to your computer and use it in GitHub Desktop.
Save mitchellhislop/1706474 to your computer and use it in GitHub Desktop.
SimpleModal Setup
$(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