日期:2014-05-16  浏览次数:20462 次

一段基于jQuery代码不支持1.9.1帮忙看下谢谢!
这段代码只支持1.6不支持1.9.1但我网站以经济与1.9.1开发了,换1.6兼容问题可能有,如何让这段代码支持1.9.1谢谢了!
(function($) {

/*---------------------------
 Defaults for Reveal
----------------------------*/
 
/*---------------------------
 Listener for data-reveal-id attributes
----------------------------*/

$('a[data-reveal-id]').live('click', function(e) {
e.preventDefault();
var modalLocation = $(this).attr('data-reveal-id');
$('#'+modalLocation).reveal($(this).data());
});

/*---------------------------
 Extend and Execute
----------------------------*/

    $.fn.reveal = function(options) {
        
        
        var defaults = {  
     animation: 'fadeAndPop', //fade, fadeAndPop, none
    animationspeed: 300, //how fast animtions are
    closeonbackgroundclick: true, //if you click background will modal close?
    dismissmodalclass: 'close-reveal-modal' //the class of a button or element that will close an open modal
     }; 
    
        //Extend dem' options
        var options = $.extend({}, defaults, options); 

        return this.each(function() {
        
/*---------------------------
 Global Variables
----------------------------*/
         var modal = $(this),
         topMeasure  = parseInt(modal.css('top')),
topOffset = modal.height() + topMeasure,
           locked = false,
modalBG = $('.reveal-modal-bg');

/*---------------------------
 Create Modal BG
----------------------------*/
if(modalBG.length == 0) {
modalBG = $('<div class="reveal-modal-bg" />').insertAfter(modal);
}     
     
/*---------------------------
 Open & Close Animations
----------------------------*/
//Entrance Animations
modal.bind('reveal:open', function () {
  modalBG.unbind('click.modalEvent');
$('.' + options.dismissmodalclass).unbind('click.modalEvent');
if(!locked) {
lockModal();
if(options.animation == "fadeAndPop") {
modal.css({'top': $(document).scrollTop()-topOffset, 'opacity' : 0, 'visibility' : 'visible'});
modalBG.fadeIn(options.animationspeed/2);
modal.delay(options.animationspeed/2).animate({
"top": $(document).scrollTop()+topMeasure + 'px',
"opacity" : 1
}, options.animationspeed,unlockModal());
}
if(options.animation == "fade") {
modal.css({'opacity'