언어 설정

Menu
Sites
Language
popup menu (div) can't be hide normally on Device but ok on Simulator.

currently i am trying to implement a pop menu on top of one page when active a action.

actuall the popup menu is DIV strcture names "rootNode" which includes 2 function as below:

    this.show = function() {
        this._rootNode.css("visibility", "visible");
    };

    this.hide = function() {
        alert("visibility hidden");
        this._rootNode.css("visibility", "hidden");
//        this._rootNode.css("display", "none");
    };

which the problem is everything is ok when the app is running on Simulator,

but the popup menu can't be hide normally on Device when hide function is actived , always displaying.

does it relate to the difference Brower between Simulator and Device? any way to reslove it?

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 댓글
Ram Sahu
Hi, can you share your more piece of code so that we can understand why it not working on device. You can check with different browser and see if it will work or not. From your code it is not clear that what exact problem is. Write steps to reproduce your issue.
eric zhang
/** * Create popup menu item. */ function MenuItemWD(content, clickhandler) { this._menu = null; this._clickHandler = clickhandler; this._node = $(""); this._node.html(content); var thispointer = this; this._node.bind("tap", function() { thispointer.callBack(); }); this.getNode = function() { return this._node; }; this.callBack = function() { this._menu.hide(); this._clickHandler(); }; this.setMenu = function(menu) { this._menu = menu; }; } /** * Create popup menu. * @param parentnode * @param title * @returns */ function MenuWD(parentnode, title) { this._parentNode = parentnode; this._rootNode = $("
"); this._backgroundNode = $(""); var thispointer = this; this._backgroundNode.bind("tap", function() { thispointer.hide(); }); this._backgroundNode.appendTo(this._rootNode); this._menuNode = $(""); this._menuNode.appendTo(this._rootNode); this._titleNode = $(""); this._titleNode.html(title); this._titleNode.appendTo(this._menuNode); this._rootNode.appendTo(this._parentNode); this._rootNode.css("visibility", "hidden"); this._menuItemsCount = 0; this.addMenuItem = function(menuitem) { if (this._menuItemsCount > 0) { this.appendNewline(this._menuNode); } menuitem.setMenu(this); menuitem.getNode().appendTo(this._menuNode); this._menuItemsCount++; //this.appendNewline(this._menuNode); }; this.show = function() { this._rootNode.css("visibility", "visible"); }; this.hide = function() { this._rootNode.css("visibility", "hidden"); }; this.appendNewline = function(node) { var div = $("
"); div.appendTo(node); }; } function commentItemWE(parentNode, status){ this._parentNode = parentNode; this._status = status; this._menuCm = new MenuWD(this._parentNode, "Choose your Operation"); //reply comment item var thispointer = this; this._menuitemCm1 = new MenuItemWD("Reply", function() { //comment id & weibo id. alert("you clicked reply btn"); }); this._menuCm.addMenuItem(this._menuitemCm1); //delete comment (itemweiboLib.getActiveAccount().UID) var cUserId = curActiveUserId; if(this._status.userId == cUserId || this._status.rootUserId == cUserId){ this._menuitemCm2 = new MenuItemWD("Delete", function() { alert("you clicked delete btn"); }); this._menuCm.addMenuItem(this._menuitemCm2); } //cancel comment pop up menu this._menuitemCm3 = new MenuItemWD("cancel", function() { alert("you clicked cancal btn"); }); this._menuCm.addMenuItem(this._menuitemCm3); this.showMenu = function() { this._menuCm.show(); }; this.getNode = function() { var nodeDiv = $("
"); this.createCmPic().appendTo(nodeDiv); this.createCmInfo().appendTo(nodeDiv); ......... var thispointer = this; nodeDiv.bind("tap", function() { thispointer.showMenu(); }); return nodeDiv; }; .......... } function initialCommentsList(data) { .......... for (var i = 0; i < count; i++) { var row = new commentItemWE($("#weiboPage"), data.comments[i]); $("#listview_cmfw").append(row.getNode()); } ......... }