我正在尝试为按钮实现此效果:
我一直在与它争斗几个小时,我能想出的最好的是CodePen.
<a href="#" class="btn-wrap">
<span class="btn btn-primary">See the Proof</span>
</a>
.btn {
border: 0;
border-radius: 0;
font-weight: 300;
font-size: 20px;
text-transform: uppercase;
}
.btn-primary {
position: relative;
-webkit-transition: all .2s ease;
-moz-transition: all .2s ease;
transition: all .2s ease;
}
.btn-primary:before, .btn-primary:after {
position: absolute;
content: '';
right: -20px;
width: 10px;
height: 50%;
background: inherit;
}
.btn-primary:before {
top: 0;
transform: skewX(30deg);
}
.btn-primary:after {
bottom: 0;
transform: skewX(-30deg);
}
.btn-wrap {
position: relative;
display: inline-block;
} …Run Code Online (Sandbox Code Playgroud) 我想在点击按钮时旋转按钮内的图像.我尝试使用ImageView并且它可以工作但是为了可访问性目的,我需要使用Button而不是ImageView.
这里的向下箭头是按钮背景.
单击按钮显示额外数据,并旋转背景箭头.如何在点击时设置动画并旋转按钮背景?
布局代码供参考:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" >
<LinearLayout
android:id="@+id/cases_actions_row"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal" >
<Button
android:id="@+id/case_action_item_1"
style="@style/card_action_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<Button
android:id="@+id/case_action_item_2"
style="@style/card_action_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
</LinearLayout>
<Button
android:id="@+id/cases_expand_button"
style="@style/card_action_button"
android:layout_height="20dp"
android:layout_width="20dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_arrow" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我需要在我的gridview分页中只显示3个元素,然后在按钮分页中显示3个按钮,但按钮动态变化.
示例按钮分页:
[1]-2-3...
Run Code Online (Sandbox Code Playgroud)
单击第二个元素
[2]-3-4...
Run Code Online (Sandbox Code Playgroud)
我的代码:
public function search($params)
{
$query = Area::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 3,
],
]);
Run Code Online (Sandbox Code Playgroud)
谢谢 !!
在Excel VBA中,我想按一个按钮,运行一些代码,并且在代码运行时,出现一个窗体窗口,显示诸如“代码正在运行,请等到完成。单击停止按钮以终止代码”。
但是每次我显示表单时,代码都会停止,等待表单窗口关闭后再继续。有没有办法在打开窗体窗口时强制代码继续运行?谢谢!
回答:在.Show末尾添加(False)或将表单的ShowModal属性更改为False。然后在fmRunning.Show(False)之后添加Application.Wait(Now + TimeValue(“ 0:00:01”))。或插入“ DoEvents”而不是Application.Wait,谢谢大家!
我一直在阅读有关Tkinter中浏览按钮问题的几篇帖子,但我找不到答案.
所以我编写了这段代码,以便在单击"浏览"按钮时获取目录路径,并在输入字段中显示此路径.它的部分内容是:当我运行脚本时,会直接弹出一个文件浏览器窗口.我确实在输入字段中获取了路径但是如果我想要使用我的浏览按钮更改文件夹它不起作用.
我不想让浏览器从一开始就弹出,但只有当我点击浏览时!谢谢你的回答
from Tkinter import *
from tkFileDialog import askdirectory
window = Tk() # user input window
MyText= StringVar()
def DisplayDir(Var):
feedback = askdirectory()
Var.set(feedback)
Button(window, text='Browse', command=DisplayDir(MyText)).pack()
Entry(window, textvariable = MyText).pack()
Button(window, text='OK', command=window.destroy).pack()
mainloop()
Run Code Online (Sandbox Code Playgroud) 该脚本附加到不在场景中的预制件.按钮有标签.
我试着在检查器中拖放按钮,但引擎不会让我.我尝试通过标签找到它,但我得到一个异常"不能隐式转换类型UnityEngine.GameObject到UnityEngine.UI.Button",当我转换时,我得到一个异常,我无法通过内置转换转换这些类型.一些帮助?如何获得对按钮的引用?这是代码:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class TankShooting : MonoBehaviour {
private Transform ShootingCameraTransform;
private PlayerTankMovement playerTankMovement;
public Button shootButton;
// Use this for initialization
void Start () {
shootButton = GameObject.FindGameObjectWithTag ("ShootButton") as Button;
shootButton.onClick.AddListener ((UnityEngine.Events.UnityAction)this.OnShootButtonClick);
playerTankMovement = GetComponent<PlayerTankMovement> ();
Transform t = transform;
foreach (Transform tr in t)
{
if (tr.tag == "ShootingCamera")
{
ShootingCameraTransform = tr.transform;
}
}
}
// Update is called once per frame
void Update () {
}
public void OnShootButtonClick() …Run Code Online (Sandbox Code Playgroud) 我正在用p5.js制作在线游戏,我想手动调用安装程序,一旦调用安装程序,我想运行draw()。
例如,如果我单击一个按钮:
<button id="somebutton" onclick="setup()">CLICK ME!!!</button>
Run Code Online (Sandbox Code Playgroud)
然后将创建画布,并运行设置中的所有内容,并运行draw()。
我有一个交互式SVG - 以全窗口大小显示.我想为它添加一些按钮.是否可以<button>在<svg>标签内添加普通元素?
我想不是,但我问的是SVG是否有类似的东西.
从一些图纸我得到这样的坏结果:https:
//jsfiddle.net/pvxr6g8k/1/
<svg version="1.1" id="svg9723" height="768" width="1268">
<g style="fill:#e6e6e6" id="g3332-7" transform="matrix(0.27404175,0,0,-0.447665,86.580009,508.16151)">
<g style="fill:#e6e6e6" clip-path="url(#clipPath3336-0-0)" id="g3334-7">
<g style="fill:#e6e6e6" transform="translate(992.5469,164.3086)" id="g3340-6">
<path inkscape:connector-curvature="0" id="path3342-2" style="fill:#e6e6e6;stroke:#241a5d;stroke-width:4.48957968;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" d="m 0,0 c -6.937,0 -12.58,5.645 -12.58,12.58 l 0,63.277 c 0,6.937 5.643,12.581 12.58,12.581 l 279.488,0 c 6.936,0 12.58,-5.644 12.58,-12.581 l 0,-63.277 C 292.068,5.645 286.424,0 279.488,0 L 0,0 Z"></path>
</g>
</g>
</g>
<text transform="scale(0.9324557,1.072437)" id="text3390-1" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:11.87269115px;font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman, Bold';writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" x="413.18262" y="390.15326">
<tspan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:'Arial Bold'" y="390.15326" x="413.18262" id="tspan3392-0" …Run Code Online (Sandbox Code Playgroud) 我有一个JavaFX应用程序,tabPane中有2个选项卡.我希望每个标签都有一个默认按钮(一个defaultButton ="true"的按钮).但是,只有第一个选项卡中的按钮会对按下Enter键做出反应.第二个选项卡中的按钮忽略按Enter键.
假设:Oracle 文档说明:
如果场景中没有其他节点使用按钮,则默认按钮是接收键盘VK_ENTER按钮的按钮.
因此,我猜问题是两个按钮都在一个场景中.你知道如何在JavaFX中获得2个标签,每个标签都有一个有效的默认按钮吗?
我的按钮文字会显示在Safari中的一行上(即使在首次点击后也是如此),但是在谷歌浏览器中,当您第一次进入该按钮时,我的按钮会显示在一行上,但是当您浏览更多帖子并再次遇到加载更多按钮时,该文字搞砸了。这仅发生在谷歌浏览器上。
当您第二次访问更多加载按钮时。
这是我的CSS ...我尝试增加宽度,虽然它解决了按钮然后没有居中的问题
.elm-wrapper {
margin: 1em auto;
text-align: center;
}
.elm-button {
-webkit-transition: all 0.15s ease;
transition: all 0.15s ease;
background-color: #ffffff;
text-shadow: none;
box-shadow: none;
border: none;
padding-top: 45px;
padding-bottom: 25px;
font-family: 'Montserrat', sans-serif;
text-transform: uppercase;
font-size: 19px;
color: #848484;
outline: none;
}
.elm-button.ajax-inactive {
display: none;
}
.elm-button.is-loading .elm-button-text {
display: none;
}
.elm-loading-anim {
display: none;
}
.elm-button.is-loading .elm-loading-anim {
display: block;
}
.elm-loading-icon {
width: 1.5em;
height: 1.5em;
}
.elm-button:not(.is-loading)::before {
content: "v"; …Run Code Online (Sandbox Code Playgroud)