popupwindow

Using JQuery to Access a New Window's DOM

守給你的承諾、 提交于 2019-11-26 17:10:51
问题 I am creating a new window that will contain text that user will print. I would like to do something similar to this: var new_win = window.open(); $(new_win.document).html("Test"); 回答1: In this case you are trying to access a dom wich has no jQuery enhancement. You need to first load a jquery.js into this document. If done the syntax would be. var popup = window.open('/some/url.html'); popup.document.$('body').html('test'); But be very careful, in multi document management and communication

Open new tab without popup blocker after ajax call on user click

∥☆過路亽.° 提交于 2019-11-26 15:35:40
问题 I have a page that enable user to perform image manipulation via HTML5 canvas, on the page, there's a facebook share button for sharing a generated image of the canvas on facebook. When the link is clicked, an ajax request is sent to the server (ASP.NET MVC) to perform the image generation, save the image on the server, then generate a url(that links to the image) that is returned as the ajax response. The returned url is what I want to pass as the parameter for facebook to share. The issue

Android popup window not filling screen size?

若如初见. 提交于 2019-11-26 14:35:54
问题 I am trying to make a simple pop up window. But every time I make one, it ends up being super small...and not the length I want it to be. This is how the pop up looks: Here is my layout for the pop up: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/popup_element" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#444444" android:padding="10px" android:orientation=

Blur or dim background when Android PopupWindow active

心已入冬 提交于 2019-11-26 14:07:59
I would like to be able to either blur or dim the background when I show my popup window using popup.showAtLocation , and unblur/dim the background when popup.dismiss is called. I have tried applying layout params FLAG_BLUR_BEHIND and FLAG_DIM_BEHIND to my activity, but this appears to just blur and dim the background as soon my app is started. How can I do blurring/dimming just with popups? The question was about the Popupwindow class, yet everybody has given answers that use the Dialog class. Thats pretty much useless if you need to use the Popupwindow class, because Popupwindow doesn't have

Android PopupWindow with Tooltip Arrow

泪湿孤枕 提交于 2019-11-26 12:52:27
I've seen a lot of questions about removing the border of a PopupWindow by passing null or new Drawable() to setBackgroundDrawable(). I'm having the opposite problem. I want a border around my PopupWindow, preferably with a tooltip arrow pointing to my anchor. Currently, my PopupWindow has no border. I've tried adjusting the margins, the background in the xml, the width and height of the layout, listview, and listview rows to no avail. Can someone please help me get a border and an image on the top? I'm trying to stick with the android SDK with this. popup_menu_list.xml <?xml version="1.0"

How to show PopupWindow at special location?

本秂侑毒 提交于 2019-11-26 11:54:33
问题 I need to show PopupWindow under one Views shown on the screen. How can I calculate coordinates of needed View and place PopupWindow under it? Code example are more than welcome. Thanks. 回答1: Locating an already displayed view is fairly easy - here's what I use in my code: public static Rect locateView(View v) { int[] loc_int = new int[2]; if (v == null) return null; try { v.getLocationOnScreen(loc_int); } catch (NullPointerException npe) { //Happens when the view doesn't exist on screen

How to handle Pop-up in Selenium WebDriver using Java

雨燕双飞 提交于 2019-11-26 08:06:58
I want to handle sign-in part in rediff.com, but the below code doesn't work for that: driver.get("http://www.rediff.com/"); WebElement sign = driver.findElement(By.xpath("//html/body/div[3]/div[3]/span[4]/span/a")); sign.click(); String myWindowHandle = driver.getWindowHandle(); driver.switchTo().window(myWindowHandle); WebElement email_id= driver.findElement(By.xpath("//*[@id='signin_info']/a[1]")); email_id.sendKeys("hi"); If myWindowHandle is not the correct string, then let me know how to get the pop-up Window name, because I can't find the name of the pop-up window. To switch to a popup

PopupWindow - Dismiss when clicked outside

蓝咒 提交于 2019-11-26 06:05:54
问题 I have a PopupWindow on my activity, the thing is my PopupWindow still shows even when I\'m interacting with my activity (say scrolling on my list). I can scroll through my list and the PopupWindow is still there. What I want to achieve is when I\'m touching/scrolling/clicking/etc on the screen which is not the PopupWindow, I want to dismiss the PopupWindow. Just like how a menu works. If you clicked outside of the menu, the menu will be dismissed. I\'ve tried setOutsideTouchable(true) but it

Android PopupWindow with Tooltip Arrow

别说谁变了你拦得住时间么 提交于 2019-11-26 03:50:32
问题 I\'ve seen a lot of questions about removing the border of a PopupWindow by passing null or new Drawable() to setBackgroundDrawable(). I\'m having the opposite problem. I want a border around my PopupWindow, preferably with a tooltip arrow pointing to my anchor. Currently, my PopupWindow has no border. I\'ve tried adjusting the margins, the background in the xml, the width and height of the layout, listview, and listview rows to no avail. Can someone please help me get a border and an image

Android popup window dismissal

ぐ巨炮叔叔 提交于 2019-11-26 00:47:41
I have a popup window displaying when I click an item in my list activity. The problem is that the back key doesn't close it. I tried catching the back key in my list activity but it doesn't register it...then I tried registering a onkeylistener to the view I'm passing to my popup window. Like this: pop.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { // TODO Auto-generated method stub boolean res=false; if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { // do something on back. Log.e("keydown","back"); if (pw