为了账号安全,请及时绑定邮箱和手机立即绑定

为神马木有效果呢?帮忙给瞅瞅

为神马木有效果呢?帮忙给瞅瞅

正在回答

2 回答

错误太多了,改了半天…………

首先你的锚点就没写完啊

<li><a href="#" class="current">1F 男装</a></li>

<li><a href="#">2F 女装</a></li>

<li><a href="#">3F 美妆</a></li>

<li><a href="#">4F 数码</a></li>

<li><a href="#">5F 母婴</a></li>

<li><a href="#item1" class="current">1F 男装</a></li>

<li><a href="#item2">2F 女装</a></li>

<li><a href="#item3">3F 美妆</a></li>

<li><a href="#item4">4F 数码</a></li>

<li><a href="#item5">5F 母婴</a></li>


代码里面粗心写错的地方太多了,比如【var current="";】,但你后面是【current】和【currentId】混用的,这个是咋也不可能会有效果的。

类似粗心的地方还有好几处,建议自己细心检查一遍先。

0 回复 有任何疑惑可以回复我~
#1

逐梦凡 提问者

非常感谢!
2015-06-25 回复 有任何疑惑可以回复我~
#2

脆脆鲨oi 回复 逐梦凡 提问者

不客气^_^。很多时候不是咱们写的不对,而是一些小地方粗心写错。督促自己更加细心一些^_^
2015-06-26 回复 有任何疑惑可以回复我~
;(function($) {   
    $.myalerts = {
        lock: 'myAlert_lock',     
        srollBarWidth: 75,
        popupId: 'myAlert_popup_container',
        alert: function(message, title, callback) {
            if( title == null ) title = '提醒'
            $.myalerts._show(title, message, 'alert', callback);
        },
        _show: function(title, message, type, callback) {
            $.myalerts._showLock();
            $.myalerts._setProperty(title,message);
            $.myalerts._confirmEvent();
        },
        _init: function() {          
            $lock = $("<div id="+$.myalerts.lock+"></div>");
            $lock.css({
                background: '#000000',
                opacity: 0.5,
                position: 'absolute',
                top: '0',
                left: '0',
                zIndex: 99990,
                width: $(document).width(),
                height: $(document).height(),
                display: 'none'
            });                
            $('body').css({
                margin: 0,
                padding: 0,           
            }).append($lock).append('<div id="myAlert_popup_container"><dl><dt class="title">提&nbsp;醒</dt><dd class="message"</dd><dd class="pos-right"><input type="button" value="确定" /></dd></dl></div>');
            var $popup = $("#"+$.myalerts.popupId);
            $popup.css({
                left: $(window).width()/2-$("#"+$.myalerts.popupId).outerWidth()/2,
                top: $(window).height()/2-$("#"+$.myalerts.popupId).outerHeight()/2
            });
            $(window).on({
                resize: function() {
                    $lock.css({
                        width: $(window).width(),
                        height: $(document).height()  
                    });
                }
            });
        },
        _showLock: function() {
            var $lock = $("#"+$.myalerts.lock);
            var $popup = $("#"+$.myalerts.popupId);
            $lock.css({
                display: 'block',
                opacity: 0.5
            });    
            $popup.css({
                display: 'block'
            });    
        }, 
        _setProperty: function(title, message) {
            var $popup = $("#"+$.myalerts.popupId);
            $popup.find('.title').html(title).end().find('.message').html(message);
        },
        _confirmEvent:function() {
            var $popup = $("#"+$.myalerts.popupId);
            var $lock = $("#"+$.myalerts.lock);
            $popup.find(":button").click(function() {
                $popup.fadeOut(200, function() {
                    $popup.css({
                        display: 'none'
                    });
                });
                $lock.fadeOut(200, function() {
                    $lock.css({
                        display: 'none',          
                    });
                });
            });        
        }
    };
    $.myalerts._init();
    myAlert = function(message, title, callback) {
        $.myalerts.alert(message, title, callback);
    }  
})(jQuery)
;(function($) {   
    $.myalerts = {
        lock: 'myAlert_lock',     
        srollBarWidth: 75,
        popupId: 'myAlert_popup_container',
        alert: function(message, title, callback) {
            if( title == null ) title = '提醒'
            $.myalerts._show(title, message, 'alert', callback);
        },
        _show: function(title, message, type, callback) {
            $.myalerts._showLock();
            $.myalerts._setProperty(title,message);
            $.myalerts._confirmEvent();
        },
        _init: function() {          
            $lock = $("<div id="+$.myalerts.lock+"></div>");
            $lock.css({
                background: '#000000',
                opacity: 0.5,
                position: 'absolute',
                top: '0',
                left: '0',
                zIndex: 99990,
                width: $(document).width(),
                height: $(document).height(),
                display: 'none'
            });                
            $('body').css({
                margin: 0,
                padding: 0,           
            }).append($lock).append('<div id="myAlert_popup_container"><dl><dt class="title">提&nbsp;醒</dt><dd class="message"</dd><dd class="pos-right"><input type="button" value="确定" /></dd></dl></div>');
            var $popup = $("#"+$.myalerts.popupId);
            $popup.css({
                left: $(window).width()/2-$("#"+$.myalerts.popupId).outerWidth()/2,
                top: $(window).height()/2-$("#"+$.myalerts.popupId).outerHeight()/2
            });
            $(window).on({
                resize: function() {
                    $lock.css({
                        width: $(window).width(),
                        height: $(document).height()  
                    });
                }
            });
        },
        _showLock: function() {
            var $lock = $("#"+$.myalerts.lock);
            var $popup = $("#"+$.myalerts.popupId);
            $lock.css({
                display: 'block',
                opacity: 0.5
            });    
            $popup.css({
                display: 'block'
            });    
        }, 
        _setProperty: function(title, message) {
            var $popup = $("#"+$.myalerts.popupId);
            $popup.find('.title').html(title).end().find('.message').html(message);
        },
        _confirmEvent:function() {
            var $popup = $("#"+$.myalerts.popupId);
            var $lock = $("#"+$.myalerts.lock);
            $popup.find(":button").click(function() {
                $popup.fadeOut(200, function() {
                    $popup.css({
                        display: 'none'
                    });
                });
                $lock.fadeOut(200, function() {
                    $lock.css({
                        display: 'none',          
                    });
                });
            });        
        }
    };
    $.myalerts._init();
    myAlert = function(message, title, callback) {
        $.myalerts.alert(message, title, callback);
    }  
})(jQuery)


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为神马木有效果呢?帮忙给瞅瞅

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信