单击图像显示Div

时间:2014-02-26 13:49:58

标签: javascript jquery

我正在使用jQuery 1.9.1。 div自动隐藏在chrome中。

在Chrome中显示

  

未捕获的SyntaxError:意外的标记var

我的代码:

index.init_context_menu = function (e) {
var obj_click_target = main.get_click_target(e);
var str_click_target_id = $(obj_click_target).parent().parent().attr("id");
var n_entry_id = str_click_target_id.substring(4);

$("div.context_menu_template ul li").unbind();

//set context menu position and css
$("div.context_menu_template")
    .removeClass("context_menu_hidden")
    .css("left", e.pageX + 20)
    .css("top", e.pageY + 15);

//edit entry
$("div.context_menu_template ul li.edit")
    .click(function() {
        $.colorbox({
            href:'/tdd/manage/form_main.aspx?entry_id=' + n_entry_id,
            height:740,
            width:740,
            onComplete:function() {manage.init_entry_form();},
            onClosed:function() {  
                tinymce.execCommand('mceRemoveControl',true,'entry_content');
            }
        });
    });


//delete
$("div.context_menu_template ul li.delete")
    .click(function() {
        manage.delete_entry_by_ajax(n_entry_id);
    });

};

它在点击的图像上方显示一个div。它在FF中工作正常,但在IE和Chrome中无法正常工作

我在谷歌搜索了超过4小时,并试图删除我的所有代码。我没有得到这个问题的实际解决方案。

我将jQuery版本从1.9.1升级到1.11.0,但仍显示相同的错误。我在页面中只使用了一个jQuery库文件。

使用调试器我在下面的代码中发现div正在隐藏。

c.handler && (i = c, c = i.handler, e = i.selector), c.guid || (c.guid = n.guid++), (g = r.events) || (g = r.events = {}), (k = r.handle) || (k = r.handle = function(a) {
                return typeof n === L || a && n.event.triggered === a.type ? void 0 : n.event.dispatch.apply(k.elem, arguments)
            }, k.elem = a), b = (b || "").match(F) || [""], h = b.length;

你能帮我解决这个问题吗?

由于


抱歉,这不是jQuery问题。

点击html我写了隐藏div。这不适用于chrome。

非常感谢你宝贵的时间。

0 个答案:

没有答案