我正在尝试创建一个Google Chrome扩展程序,在页面加载时按下按钮.我已经能够使用此代码使用VBscript为Internet Explorer触发按钮:
IE.Navigate("javascript:changeIframe();")
Run Code Online (Sandbox Code Playgroud)
但是,现在我需要通过扩展程序在Google Chrome中执行此操作.但是,该按钮没有id:
<input type="button" value="Start!" onclick="javascript:changeIframe();">
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止所尝试的,似乎没有任何效果:
window.onload="javascript:changeIframe()";
javascript:changeIframe();
document.getElementById('').click();
document.getElementById('').submit();
Run Code Online (Sandbox Code Playgroud)
它似乎.click并.submit没有在Google-Chrome的javascript中定义?
奇怪的是,当我使用这个脚本时:
javascript:changeIframe();
Run Code Online (Sandbox Code Playgroud)
在Chrome的javascript控制台中,它会自动按下按钮,一切正常.但是,当我在.js文件中放入相同的脚本时,它不起作用.
我只需要知道我必须在我的.js中放置什么才能在页面加载时自动按下按钮.
我已经为我的Silverlight按钮创建了一个样式模板,设法创建圆角和悬停状态,这会改变大多数样式而没有任何问题,但是......
我无法弄清楚如何Foreground改变颜色hover.
请参阅下面的代码,我遇到问题的部分目前已被注释掉.
<Style TargetType="Button" >
<Setter x:Name="myFontColor" Property="Foreground" Value="#000000"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontStyle" Value="Normal"/>
<Setter Property="FontFamily" Value="Arial"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Height="28">
<Border x:Name="myBorder" BorderBrush="#C4C4C4" BorderThickness="1" CornerRadius="5">
<Rectangle x:Name="BackgroundGradient" RadiusX="5" RadiusY="5">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop x:Name="GradientStop1" Color="#FDFDFD" Offset="0" />
<GradientStop x:Name="GradientStop2" Color="#D6D6D6" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Border>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommomStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation
Storyboard.TargetName="GradientStop1"
Storyboard.TargetProperty="Color"
From="#FDFDFD" To="#0A284B" …Run Code Online (Sandbox Code Playgroud) 我是Android开发的新手,我正在学习编写和设计一个Android项目.我有问题,ViewPager无法在本网站或Google搜索中找到答案.
问题:Button当它进入时,我无法执行它的动作ViewPager.
你可以在这里看到我的项目和apk文件:https://dl.dropbox.com/u/9820517/ForOneTimeDownload/TestPagerView.rar
这是我的PagerDemo.java:
public class PagerDemo extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_pager_demo);
myPagerAdapter adapter = new myPagerAdapter();
ViewPager myPager = (ViewPager) findViewById(R.id.myfivepanelpager);
myPager.setAdapter(adapter);
myPager.setCurrentItem(2);
SetAllBtnFunc();
}
public void SetAllBtnFunc() {
//all func
View.OnTouchListener touch = new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
Log.d("hlv_trinh", "Button be Touched!");
return false;
}
};
View.OnClickListener click = new …Run Code Online (Sandbox Code Playgroud) 我有一个输入按钮元素,我想包括"带我去那里",但我想使角括号与文本的其余部分不同.
这可能吗?如果有必要,我很乐意使用javascript或jquery修复程序.
当我在编辑器中时,我注意到对象库中有复选框.但是当我去故事板时它们就消失了.那么有没有办法在iPhone界面中添加chechbox或者它们是否适用于其他平台?如果不可能,还有其他什么可以做同样的工作吗?我正在制作搜索功能,如果检查了chechbox,我想在搜索中添加一个标准,这就是为什么我需要这样的东西.谢谢.
是否可以在APEX主页上(登录后)使用4个按钮在Oracle APEX中设计页面(或区域)?
我试过,但我不知道该怎么做.
我尝试使用自定义HTML,使用表格和HTML按钮,但不显示HTML按钮.
提前致谢.
我需要在长按列表项时显示删除按钮.
我有长按的代码..但不知道如何编码在这个长按内显示一个按钮...
我有一个网页 - http://www.example.com/ - 我有一个按钮.点击按钮,我需要转到特定链接(www.google.com).按钮如下:
<input type="button"
onclick="javascript:location.href='www.google.com'"
value="Click" />
Run Code Online (Sandbox Code Playgroud)
但是,此按钮会打开一个页面"http://www.example.com/www.google.com",这是一个错误的网址.
我已经试过window.location,document.location,document.location.href,location.href但一切都是徒劳.
我的onclick中的URL不能限制为以'http://'开头.
我正在研究Unicreatures的用户脚本,用于跟踪探索期间的事件.它工作(好吧,它工作,但仍然需要一些工作大声笑)但我需要一种方法来显示我正在收集的信息,不涉及每个步骤的弹出警报.
我想在这个页面的菜单左侧创建一个框架,窗口,并在我的脚本运行时将各种变量的值写入其中.
我正在localStorage中收集这些数据,所以我的脚本将首先更新各种localStorage属性,然后以某种方式在此框中显示结果:
localStorage.steps = Number(localStorage.steps) + 1;
displayValueInFloatingBox(localStorage.steps + ' in Sargasso' );
Run Code Online (Sandbox Code Playgroud)
我还想在此框中添加一个按钮来重置这些属性的值,这样我就可以选择永久保持跟踪,或者只选择一两个会话,而不必每次都编辑脚本(特别是如果我决定的话)分享剧本).我假设这只是将变量设置为零,所以我只需要知道如何创建按钮并使它做某事......这可能会以某种方式使用eventListener.
请坚持使用简单的JavaScript,没有jQuery ......我现在还没有获得JavaScript.请解释答案,这样我就能理解某些东西是如何工作的 - 我不仅仅希望代码片段让我回到类似的问题,因为我不明白为什么会使用一些代码.
// ==UserScript==
// @name Unicreatures Egg pop-up
// @namespace Unicreatures Egg pop-up
// @description Unicreatures Egg pop-up
// @include http://unicreatures.com/explore.php*
// @include http://www.unicreatures.com/explore.php*
// ==/UserScript==
var regexp = /You find an? (Exalted )?(.*?) egg nearby/;
var match = regexp.exec( document.body.innerHTML );
if ( match ) {
if ( match[1] ) {
alert( "Exalted egg found: " + …Run Code Online (Sandbox Code Playgroud) 我需要在点击时为我的按钮添加一个边框,我需要按钮的背景(我得到远程,所以我不能使用R.drawable.picture等)保持原样.
简而言之,当点击时,我想为我的(自定义背景)按钮添加边框.
我该怎么做呢?我已经在边框,按钮,形状,选择器等上阅读了很多页面和问题,但是大多数都涉及到xml,但是因为在启动应用程序之前我没有按钮的背景,我想我是绑定以编程方式添加和删除边框.同样,我需要保留自定义按钮背景,但添加一个小的onclick边框.
注意:我在所有具有不同尺寸的按钮上使用此功能.因此,应用drawable不是一个真正的选择.我想我必须在点击的按钮周围画一个矩形.
注2:再次,我有一个必须应用的背景.边界只是onclick事件的一个小指标.所以我不能在XML中提出背景是某种选择器
button ×10
javascript ×4
android ×3
onclick ×2
border ×1
css ×1
greasemonkey ×1
hover ×1
input ×1
interface ×1
iphone ×1
jquery ×1
listview ×1
long-press ×1
oracle ×1
oracle-apex ×1
region ×1
silverlight ×1
storyboard ×1
webpage ×1
xcode ×1