popupwindow

Open new window on center of screen with this javascript?

雨燕双飞 提交于 2019-12-06 06:08:08
My experience with javascript is extraordinarily limited. I would like to have the new window open up in the center of the screen. <script type="text/javascript"> function fbs_click() { var twtTitle = document.title; var twtUrl = location.href; var maxLength = 140 - (twtUrl.length + 1); if (twtTitle.length > maxLength) { twtTitle = twtTitle.substr(0, (maxLength - 3)) + '...'; } var twtLink = 'http://twitter.com/home?status=' + encodeURIComponent(twtTitle + ' ' + twtUrl); window.open(twtLink,'','width=300,height=300'); } </script> If somebody can please update my code to accomplish a popup

使用 PopupWindow 的时候遇到Activity com.avcit… has leaked

冷暖自知 提交于 2019-12-06 03:48:18
在OnCreate方法中调用 popupWindow.showAtLocation(view, Gravity.LEFT | Gravity.TOP, x, y); 时,会出现以下错误: Activity com.avcit.conference.MainActivity has leaked window android.widget.PopupWindow$PopupViewContainer@406dfc10 that was originally added here android.view.WindowLeaked: Activity com.avcit.conference.MainActivity has leaked window android.widget.PopupWindow$PopupViewContainer@406dfc10 that was originally added here 这是因为这个popupWindow依赖的父Activity已经finish()的了,但是它还存在,所以回有上面的提示。 有两种解决办法: (1)在onPause()中将它dismiss()了。 <!-- lang: java --> @Override protected void onPause() { // TODO Auto-generated method

How to disable location bar and scroll bars of pop window in Chrome?

﹥>﹥吖頭↗ 提交于 2019-12-06 02:16:09
问题 For the following code width and height are working in Chrome but location and scrollbar are not working. Please guide. <script language="JavaScript"> function newwindow() { window.open('http://localhost/a.php', 'jav', 'width=300,height=200,resizable=yes,location=no,scrollbars=no'); } </script> <a href="javascript:newwindow()">Click Here</a> 回答1: Chrome will not allow you to do this for security reasons. Hiding the address bar makes it easier to pretend you're somebank.com when really you're

Android Activity启动后立即弹出PopupWindow的两个方法

隐身守侯 提交于 2019-12-05 23:45:06
Activity启动后立即弹出PopupWindow的两个方法 若在Activity的onCreate()方法中直接写弹出PopupWindow方法会报错, 因为activity没有完全启动是不能 弹出PopupWindow的。 那我们只需要在activity完全启动后再弹出PopupWindow就行了。 第一种方法: 利用Activity的 onWindowFocusChanged()方法 @Override public void onWindowFocusChanged(boolean hasFocus) { // TODO Auto-generated method stub super.onWindowFocusChanged(hasFocus); // 弹出PopupWindow的具体代码 } 第二种方法: 利用Handler和Runnable private Handler mHandler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main); mHandler

PopupWindow源码分析

懵懂的女人 提交于 2019-12-05 23:43:10
目录介绍 1.最简单的创建方法 1.1 PopupWindow构造方法 1.2 显示PopupWindow 1.3 最简单的创建 1.4 注意问题宽和高属性 2.源码分析 2.1 setContentView(View contentView) 2.2 showAsDropDown()源码 2.3 dismiss()源码分析 2.4 PopupDecorView源码分析 3.经典总结 3.1 PopupWindow和Dialog有什么区别? 3.2 创建和销毁的大概流程 3.3 为何弹窗点击一下就dismiss呢? 4.PopupWindow封装库介绍 好消息 博客笔记大汇总【16年3月到至今】,包括Java基础及深入知识点,Android技术博客,Python学习笔记等等,还包括平时开发中遇到的bug汇总,当然也在工作之余收集了大量的面试题,长期更新维护并且修正,持续完善……开源的文件是markdown格式的!同时也开源了生活博客,从12年起,积累共计47篇[近20万字],转载请注明出处,谢谢! 链接地址: https://github.com/yangchong211/YCBlogs 如果觉得好,可以star一下,谢谢!当然也欢迎提出建议,万事起于忽微,量变引起质变! PopupWindow封装库项目地址: https://github.com/yangchong211

Android Spinner Exception when clicked BadTokenException

和自甴很熟 提交于 2019-12-05 21:27:15
I have a problem when clicking on a spinner ( in a popup window ) here is my popup: public class PopupDialog extends PopupWindow { public PopupDialog() { super(); init(); } public PopupDialog(View contentView, int width, int height) { super(contentView, width, height); init(); } public PopupDialog(View contentView) { super(contentView); init(); } private void init() { this.setTouchable(true); this.setFocusable(true); this.setOutsideTouchable(true); setBackgroundDrawable(new BitmapDrawable()); this.setTouchInterceptor(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent

How to prevent zooming in popup window in my Chrome Extension

烈酒焚心 提交于 2019-12-05 20:08:16
I just noticed that if I zoom up the web page in a tab (by doing Ctrl-Plus) and then open the popup window for my Chrome Extension it also gets scaled up. Unfortunately that makes it display a vertical and, at larger scale, even a horizontal scrollbar. I see that other extensions somehow block this zooming by displaying their popups at 100% zoom only. The question is how to do it? c00000fd Quick note for whoever is interested how I solved it. First, a little detail about Chrome that I just learned. To zoom a plug-in's popup window one needs to open its Options window from the Chrome's Settings

PopupWindow in jQuery

旧街凉风 提交于 2019-12-05 18:51:40
I am in need of a popupwindow with the option of a radio button. I have tested with Impromtu . Is any easy made Popupwindow plugin available? My plugin should work in Internet Explorer, Mozilla and Google Chrome. What would some sample code be? jqModal is great and easy-to-use for building Modal Popups and the like. If you want a tutorial on how to build one yourself without jQuery, check out this tutorial . Henk Check out Thickbox ! You can use a div or so on your page as content (see inline content demo). Here's a list of lightbox like plugins depending on your need: http://www

Make Chrome Extension Popup Window Transparent

蹲街弑〆低调 提交于 2019-12-05 18:24:41
I am writing a chrome extension. I am wondering if there is a way to make the popup window transparent, that is the user can see the content of the current page even the popup window covers it. Thank you! An interesting idea came to me mind yesterday, though you can't remove the white background, you can still mimic a transparent background. This will be done by taking a screenshot of the page right before opening the popup and place it as a background image of the popup. I'm not sure how the background-image position calculations will go and if even possible but go give it a try. Of course

Focus on EditText in a Popup Window goes the activity to sleep

∥☆過路亽.° 提交于 2019-12-05 18:08:52
I place an EditText on a PopupWindow in my android project. When set PopupWindow.setFocusable to the false, the soft keyboard will not be show. And when set PopupWindow.setFocusable to the true, the EditText is focused and activity go to sleep! Other item on the pop up window works, but back button on the phone and clicking outside the pop up does not close it. Thanks in advance. Some code from my project may help LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); PopupWindow share_popup = new PopupWindow(inflater.inflate(R.layout.share_dropdown, null