标签: button

Facebook FB.Event.subscribe不起作用

我想跟随我在页面上看到多少喜欢,但有些不对劲.我正在使用Facebook javascript事件处理程序,但它不起作用.

当我点击相似或不喜欢的按钮时,它应该提醒我,但它没有做任何事情.知道我哪里错了吗?谢谢!抱歉我的英语.

这是我的更新代码:

<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>FBlike check</title>
</head>
<body>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=00000000000000000";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk')); 

FB.Event.subscribe('edge.create',
    function(response) {
        alert('You liked the URL: ' + response);
    }
);
</script>
<fb:like href="https://www.facebook.com/XYZ" send="false" layout="button_count" width="200" show_faces="false"></fb:like>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

javascript facebook button event-handling facebook-like

3
推荐指数
1
解决办法
8507
查看次数

Python中的IndentationError

我编写了以下程序,但不确定它有什么问题,它给出了:

File "Button_2.py", line 9
""" Initialise the Frame. """
                            ^
  IndentationError: expected an indented block
Run Code Online (Sandbox Code Playgroud)

这是我的代码的图像:

在此输入图像描述

这里发生了什么?

python user-interface indentation button

3
推荐指数
1
解决办法
378
查看次数

yii中条目的下一个/上一个按钮的最佳方式

我想知道为数据库中的条目创建下一个/上一个按钮的最佳方法是什么.假设我们有一个包含图像的表格,每个图像都有一个ID和一个路径.如果当前图像的ID等于"9",我如何获得下一个和之前的ID?

我已经在这里找到了解决方案 /sf/answers/621206771/ 但这似乎是最新的选择.如果我们的数据库中有超过10000个条目(图像),这将使服务器不堪重负.首先,它选择所有条目,然后尝试复制数组中的所有结果.在此之后,搜索该阵列的当前ID.这很慢.

我正在考虑对查询设置限制但是如何在此之后获取下一张和之前的图片?

另一个(更好的,我认为)解决方案是获取当前图片的ID并递减/递增它,直到找到具有新ID的另一图像.我认为这比链接中提供的功能更快.

此外,在同一链接中还有另一个想法,即在当前图片的模型中设置prev_id和next_id.但在这里我们有同样的问题,我们如何找到它们?即使我们找到它们,在当前图片中存储有关上一张/下一张图片的数据是否正确?它似乎不对,但我确信当您需要访问该数据时更方便.

谢谢!

button next yii

3
推荐指数
1
解决办法
2612
查看次数

Foreach循环创建100个按钮,同时绘制所有按钮以防止闪烁

在我的扫雷游戏中,我需要动态创建控件,以便在easy - medium - hard之间切换.让我们说,为了问题,硬包含100个按钮.

这就是我创建它们的方式:

this.SuspendLayout(); //Creating so many things that I assume it would be faster to suspend and resume.
foreach (string i in playingField)
{

    Button button = new Button();
    button.Name = i;
    button.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
    button.Margin = new Padding(0);
    button.TabIndex = 0;
    button.Location = new System.Drawing.Point(3, 3);
    button.Size = new System.Drawing.Size(25, 25);
    button.BackgroundImage = blockImage; //##//
    button.MouseDown += new System.Windows.Forms.MouseEventHandler(this.GetUnderSide);
    button.UseVisualStyleBackColor = false;
    minesPanel.Controls.Add(button); //Adding the controls to the container
}
this.ResumeLayout(); //Refer to above. Correct …
Run Code Online (Sandbox Code Playgroud)

c# controls button

3
推荐指数
1
解决办法
5730
查看次数

此代码会立即将文本框更改为红色.我想要它,点击按钮然后红色,然后再绿色

此代码会立即将文本框更改为红色.我想要它,点击按钮然后红色,然后再绿色.

private void button1_Click(object sender, EventArgs e)
{

    textBox1.BackColor = System.Drawing.Color.Black;

    if (textBox1.BackColor.Equals(System.Drawing.Color.Black)) 
    {
        textBox1.BackColor = System.Drawing.Color.Red;
    }



    if (textBox1.BackColor.Equals(System.Drawing.Color.Red))
    {
        textBox1.BackColor = System.Drawing.Color.Green;
    }



    if (textBox1.BackColor.Equals(System.Drawing.Color.Green))
    {
        textBox1.BackColor = System.Drawing.Color.Blue;
    }



    if (textBox1.BackColor.Equals(System.Drawing.Color.Blue))
    {
        textBox1.BackColor = System.Drawing.Color.Red;
    }
}
Run Code Online (Sandbox Code Playgroud)

c# if-statement button

3
推荐指数
2
解决办法
2765
查看次数

Java:为什么我的JButton被绘制在背景图像后面?

这是存在问题的JPanel类:

public class EntryDialog extends JPanel{

private static final long serialVersionUID = 1L;

MainWindow         mainWindow;
Image              background;
JButton            continueresume;
JButton            newresume;
JButton            settings;
JButton            exit;

public EntryDialog(MainWindow mainWindow){

    continueresume            = new JButton("Continue resume");
    newresume                 = new JButton("New resume");
    settings                  = new JButton("Settings");
    exit                      = new JButton("Exit");
    this.mainWindow           = mainWindow;
    this.background           = Utilities.getImage("images\\entryDialogBackground.jpg", true);

    this.setLayout(null);

    //continueresume button
    continueresume.setBounds(Utilities.getScaledWidth(1150), 
            Utilities.getScaledHeight(150), 
            Utilities.getScaledWidth(500), 
            Utilities.getScaledHeight(50));

    //newresume button
    newresume.setBounds(Utilities.getScaledWidth(1150), 
            Utilities.getScaledHeight(220), 
            Utilities.getScaledWidth(500), 
            Utilities.getScaledHeight(50));

    //settings button
    settings.setBounds(Utilities.getScaledWidth(1150), 
            Utilities.getScaledHeight(290), 
            Utilities.getScaledWidth(500), 
            Utilities.getScaledHeight(50));
    //exit button
    exit.setBounds(Utilities.getScaledWidth(1150), 
            Utilities.getScaledHeight(360), 
            Utilities.getScaledWidth(500), 
            Utilities.getScaledHeight(50));

    this.add(continueresume);
    this.add(newresume); …
Run Code Online (Sandbox Code Playgroud)

java swing button paintcomponent

3
推荐指数
1
解决办法
3963
查看次数

如何判断是否单击了按钮

我有这个代码:

<script type="text/javascript">
function changestate()
{
    var StateTextBox = document.getElementById("State");
    var IgnoreTextBox = document.getElementById("Ignore");
    var PlayButton = document.getElementById("Play");
    if(document.getElementById("Play").onclick == true)
    {
        StateTextBox.value = "Happy";   
    }
}
</script>
<input TYPE="button" VALUE="Play with Pogo" id="Play" onClick="changestate();"/>
Run Code Online (Sandbox Code Playgroud)

我试图知道何时单击该按钮,并在if语句中单击该按钮.我想知道这一点,所以我可以更改文本框内的值.问题是,我不知道如何判断单击按钮的时间.如果你能帮助我,那就太好了.

html javascript if-statement button

3
推荐指数
1
解决办法
3万
查看次数

CSS按钮值样式

如果我有这行代码:

<input type="submit" class="mybutton" name="add" value="Add new"/>
Run Code Online (Sandbox Code Playgroud)

如何使用CSS设置按钮值的样式?我需要在值之前添加一个图像,因此在值输出处需要以下代码行:

<span class="add">Add new</span>
Run Code Online (Sandbox Code Playgroud)

我尝试过类似的事情:

<input type="submit" class="mybutton" name="add" value="">
<span class="add">Add new</span></input>
Run Code Online (Sandbox Code Playgroud)

哈哈,但这完全没有任何意义。

有人给个小费吗?

编辑

哇,谢谢您的快速回复。忘了提一下,我使用的是“ sexybuttons”的.CSS文件,因此无法更改样式,而需要其他方法。

<button type="submit">
Run Code Online (Sandbox Code Playgroud)

是我一直在寻找的东西。非常感谢大家。

html css button styling

3
推荐指数
1
解决办法
3万
查看次数

Android:使默认的holo按钮不透明

默认情况下,ICS中的按钮有点透明.我想要实现按钮保持其所有属性(形状,颜色,状态按下),而不是使其不透明.

我怎么能实现这一目标?

提前致谢!

java transparency android button android-layout

3
推荐指数
1
解决办法
1611
查看次数

按钮中的自定义TextView

我创建了一个自定义textview类.通过这个类,我可以设置字体,设置文本的内部阴影,设置文本的外观,设置文本的半径和颜色.我想在按钮中的文本中使用这些文本视图的特征.我通过谷歌研究,但我没能找到解决我的问题的解决方案.所以,如果有人对这个主题有任何想法,那么你将会有很大的帮助.

我在textview中定义的属性是

    xmlns:braindigit="http://schemas.android.com/apk/res/com.example.MyCustomTextView" //this is in the main layout        

   <com.example.MyCustomTextView
    android:id="@+id/stateInfo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/you_are_not_logged_in"
        android:textColor="#3191d2"
        android:textSize="18sp"
        android:textStyle="bold"
        braindigit:innerShadowColor="#003456"
        braindigit:innerShadowDy="1"
        braindigit:innerShadowRadius="1"
        braindigit:outerShadowColor="#ffffff"
        braindigit:outerShadowDy="1"
        braindigit:outerShadowRadius="1" />
Run Code Online (Sandbox Code Playgroud)

自定义textview没有问题.但是,我不知道如何将这些自定义文本值用于我的按钮.

android button textview

3
推荐指数
1
解决办法
1760
查看次数