can not unset (delete) a variable ?
hello,
I have some code that gets a class and puts it in to a "var" but i want it to unset when the lightbox is closed ?
The way the code works is it puts an image class in to a var then when you click the image it opens up a lightbox with the same class. The problem is when i close the lightbox it does not unset the var so when i click the next image it opens the same lightbox window and not the correct one ? unless i refresh the page.
how can i unset the var when the lightbox is closed
this is the code:
jQuery(function ($) {
$('#location .basic').click(function (e) {
var secondClass = $(this).attr('class').split(' ')[1];
$("div." + secondClass).modal();
$('#basic-modal-content').css('display', 'block');
return false;
});
$('.close a').click(function(){
$('#basic-modal-content').css('display', 'none');
delete secondClass;
});
});
delete secondClass; doesn't seem to work
thanks
rick