我试图用下面的代码设置按钮颜色的样式,颜色一直工作,直到我点击按钮,按钮显示默认颜色,如何指定按钮onclick的颜色?
.btn-success {
color: #ffffff;
background-color: #161617;
border-color: #494F57;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #1F2838;
border-color: #494F57;
}
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #161617;
border-color: #494F57;
}
.btn-success .badge {
color: #161617;
background-color: #ffffff;
}
Run Code Online (Sandbox Code Playgroud) 我正在使用无限的ajax滚动.它正在工作,因为我可以点击加载更多项目,这将加载内容.然而,我应该停在最后一页,并显示"没有更多的帖子",而是它仍然显示"加载更多项目"链接,点击时再次从第2页开始分页.
安慰:
Welcome at page 2, the original url of this page would be: /website/home/2
Welcome at page 3, the original url of this page would be: /website/home/3
Run Code Online (Sandbox Code Playgroud)
我应该显示"没有更多的帖子" - 而是继续如下:
Welcome at page 4, the original url of this page would be: /website/home/2
Welcome at page 5, the original url of this page would be: /website/home/3
Run Code Online (Sandbox Code Playgroud)
IAS:
<script type="text/javascript">
var ias = $.ias({
container: "#posts",
item: ".post",
pagination: "#pagination",
next: ".next a"
});
ias.extension(new IASSpinnerExtension());
ias.extension(new IASTriggerExtension({offset: 1}));
ias.extension(new …Run Code Online (Sandbox Code Playgroud) 我正在使用datepicker与from和to date.
在PHP中发布这些日期时,日期格式为mm/dd/yyyy.
我需要将其转换为MySQL格式yyyy-mm-dd
可以这样做吗?
$from = $_GET['from'];
$phpdate = strtotime( $from );
$from_date = date( 'Y-m-d', $phpdate );
Run Code Online (Sandbox Code Playgroud)
我试过这个,但它不起作用.
我目前有4个按钮,其中一个将使用Intent打开Web浏览器。我想使用webview打开浏览器。我已经看到了此代码,但不确定如何实现。
如果我使用此代码:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebViewClient(new MyWebViewClient());
Run Code Online (Sandbox Code Playgroud)
并更改xml文件以包含WebView,它将其添加到我不需要的当前主屏幕中。我只想在用户单击按钮后使用WebView。我该怎么做呢?
xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/android"
>
<ScrollView
android:id="@+id/settingsScrollView"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
</ScrollView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<Button
android:id="@+id/Info"
android:layout_height="100dp"
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/Info"
android:background="@drawable/button_colour"
android:textSize="14sp"
android:textStyle="bold"
/>
<Button
android:id="@+id/Search"
android:layout_height="100dp"
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/Search"
android:background="@drawable/button_colour"
android:textSize="14sp"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<Button
android:id="@+id/Facebook"
android:layout_height="100dp"
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/Facebook"
android:background="@drawable/button_colour"
android:textSize="14sp"
android:textStyle="bold"
/>
<Button
android:id="@+id/Twitter"
android:layout_height="100dp"
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/Twitter"
android:background="@drawable/button_colour"
android:textSize="14sp"
android:textStyle="bold"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
MainActivity:
@Override
protected void onCreate(Bundle …Run Code Online (Sandbox Code Playgroud)