我有一个隐藏的div,在我的表单中有特定的错误消息.在表单提交之前,我运行一个验证例程来检查是否所有必填字段都填充了一些文本.如果没有,则在文本字段正上方可以看到具有"redAlert"类的div.我还希望在显示错误消息时,对话框窗口向右滚动到此位置.我知道有很多插件可用于此,但我想使用简单的Jquery来做.我正在尝试A)使用类redAlert找到第一个可见的div,b)通过调用此div上的.offset()然后c)在窗口对象上调用.scroll()找到它的位置但是我没有得到这个上班.如果我完全错过了某些内容或者我的语法无效,请告诉我(我经常发现自己在使用Jquery时遇到语法错误).以下是我的代码.另外 - 这只找到可见的div(假设一次只有一个错误div),你能不能给我一个选择器来查找特定类的第一个可见div.
var errorDiv = $('.redAlert:visible').attr("id");
var scrollPos = $("#"+errorDiv ).offset();
//alert(scrollPosition); // This alert always says 'null', why ?
$(window).scroll(scrollPos);
//Also tried scrollTo();
Run Code Online (Sandbox Code Playgroud)
非常感谢提前.
我和我的团队最近在Google Play上发布了一个应用.我的知识告诉我,我需要做的就是每次上传新的APK时更改AndroidManifest.xml文件中的versionCode,从那里,Google Play会向用户通知可用的更新.我与许多现实世界的用户保持联系,他们说他们从未收到有关应用更新的通知,尽管我们已经发布了原始应用的几个更新.我知道有一些设备级别的Playstore设置,例如"仅在wi-fi上更新应用程序"等,我已经验证了所有这些场景组合.我仍然认为所有用户都没有收到有关新版本的通知.所以我的问题是
1)我首先错过了什么?
2)我有哪些选项可以确保用户收到有关可用更新的通知?
使用诸如watermark.js之类的插件在Jquery数据表的搜索字段中添加灰色提示文本不是一个选项,我必须自定义编写它.我几乎在那里,但面对下面的代码片段解释这个小而奇怪的问题.
function toggleHintText()
{
// alert("The hint text should show up");
var textSuggest = "Please input search parameter";
var searchField = $('input:text');
searchField .attr("value", textSuggest );
searchField .addClass("activeHint");
searchField .focus(function() {
if(searchField .attr("value") == textSuggest)
{
searchField .attr("value", "");
}
});
searchField .keyup(function() {
if(searchField .attr("value") == "")
{
searchField .addClass("activeHint");
}
else
{
searchField .removeClass("activeHint");
}
});
searchField .blur(function() {
if(searchField .attr("value") == "")
{
searchField .attr("value", hinttext);
searchField .addClass("activeHint");
}
});
Run Code Online (Sandbox Code Playgroud)
此方法称为onload,如下所示
$(document).ready(function() {
populateTableData();
toggleHintText();
} …Run Code Online (Sandbox Code Playgroud) 我有一个id为给<tr id="tagTR">
定上述,是否有可能找到下一个input:text元素,无论其间是否有任何其他标记.是否有一个jQuery选择器,我可以用于这种情况?
例如 :
<tr id="tagTR">
</tr>
<tr id="tagRed">
<td> </td>
</tr>
<div>
<tr>
<td>
<input> // This is what I want to get to.
</td>
</tr>
</div>
Run Code Online (Sandbox Code Playgroud) 我遇到了这个问题,从一些谷歌搜索我意识到这可能是Chrome和Safari浏览器中的一个错误.
当我提交表单(基本上,进行ajax调用)时,默认光标变为等待光标(沙漏),当ajax调用完成(响应)时,光标变为默认类型(箭头).但是,这仅适用于IE和FF.在Chrome中,光标仍然是沙漏光标,直到我执行诸如移动光标或发出警报等操作.
我尝试了一个类似于这里提到的解决方案,它使用Jquery的Ajax Stop和Start事件来触发操作,但由于某种原因它对我不起作用.
下面是我的jsp/html代码.
function SubmitForm()
{
globalAjaxCursorChange();
// some code to make Ajax call
}
function globalAjaxCursorChange()
{
$("html").bind("ajaxStart", function(){
$(this).addClass('busy');
}).bind("ajaxStop", function(){
$(this).removeClass('busy');
});
}
Run Code Online (Sandbox Code Playgroud)
这是我的CSS代码.
html.busy, html.busy * {
cursor: wait !important;
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么或我错在哪里?文章中提到的解决方案对我来说似乎非常直接,但不起作用.非常感谢任何建议.
我使用此基于Web的工具生成了动作栏样式,该工具非常常见 http://jgilfelt.github.io/android-actionbarstylegenerator/
我在工作区中将“ android-support-v7-appcompat”作为一个单独的项目。我转储了通过从该工具下载zip文件到此项目而生成的res文件夹的所有内容。
我在操作栏和上下文菜单(弹出窗口)中使用了深蓝色的颜色。但是,我无法从该主题获得自定义外观。大多数元素/组件显示默认外观。操作栏为黑色(而不是蓝色),弹出菜单为灰色(而不是浅蓝色)
我的style.xml来自值文件夹
<style name="Theme.dinemobileandro" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarItemBackground">@drawable/selectable_background_dinemobileandro</item>
<item name="popupMenuStyle">@style/PopupMenu.dinemobileandro</item>
<item name="dropDownListViewStyle">@style/DropDownListView.dinemobileandro</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.dinemobileandro</item>
<item name="actionDropDownStyle">@style/DropDownNav.dinemobileandro</item>
<item name="actionBarStyle">@style/ActionBar.Solid.dinemobileandro</item>
<item name="actionModeBackground">@drawable/cab_background_top_dinemobileandro</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_dinemobileandro</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.dinemobileandro</item>
<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">@style/Theme.dinemobileandro.Widget</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我也在清单文件中进行了必要的更改
<application
android:name="com.railyatri.in.mobile.MainApplication"
android:allowBackup="true"
android:allowClearUserData="true"
android:enabled="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.dinemobileandro" >
Run Code Online (Sandbox Code Playgroud)
我已经严格按照此博客中提到的步骤进行操作,以前它对我来说是一个夏洛克主题。 http://java.dzone.com/articles/creating-custom-android-styles 但是,这次,我迁移到了appcompat,并且它停止了工作。我已经在SO和Google上进行了大量搜索,并尝试了一些建议但无济于事的方法。
请帮忙。提前致谢。
我正在使用Jquery的数据表。我有一个ID =“ affectedRegion”的表。它有一个带有单选按钮的列。在某种程度上,此单选按钮单元格周围的一些样式赋予每行其高度。
在特殊情况下,我必须通过执行以下操作来隐藏单选按钮列
affectedRegion.fnSetColumnVis(0, false);
Run Code Online (Sandbox Code Playgroud)
但是,当我这样做时,行变得比我想要的短得多。由于此代码在许多其他地方共享,因此我想知道Jquery中是否有一种方法可以动态更改行高以保持相同的外观。
我尝试了下面的方法,但它不起作用。
$("#affectedRegion").css('height', '25px');
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助。
我试图实现以下但不确定它是否可能以及语法应该是什么?
<c:if condition is true>
<c:set cookie using JSTL>
</c:if>
Run Code Online (Sandbox Code Playgroud)
我在想,因为cookie只在客户端设置而JSTL用于服务器端的操作,所以无法完成.
所以我使用这个属性"bStateSave":true来保存jQuery Datatable的状态但是由于某种原因它对我不起作用.当我进行页面刷新时,它不会保存搜索结果和分页等.还有一些其他参数需要与这个参数一起使用.我主要是通过这个页面上的信息
http://datatables.net/examples/basic_init/state_save.html
这个代码太大了,无法发布,我不确定我应该发布什么剪辑.在此先感谢您的帮助.
我从主流中调用子流.我已经能够ShareHolderProfile从MainFlow 将对象传递给SubFlow.但是,我不确定这个相同的对象是否没有被传递回MainFlow,或者我在JSP中没有正确访问它.我是这样做的.
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="retriveAccount">
<var name="acctProfile" class="com.abc.xyz.account.ShareHolderProfile"/>
<view-state id="retriveAccount" view="AccountView">
<transition on="Success" to="createAccountSubFlow"/>
</view-state>
<subflow-state id="createAccountSubFlow" subflow="createAccountSubFlow">
<input name="acctProfile" value="acctProfile"/>
<transition on="finish" to="showAlternateRoute"/>
</subflow-state>
<view-state id="showAlternateRoute" view="showAlternateView" model="acctProfile">
<on-entry>
<evaluate someExpression result="viewScope.SomeValue"/>
</on-entry>
<transition on="viewAction" to="accountDetails"/>
</view-state>
Run Code Online (Sandbox Code Playgroud)
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="showAccount">
<input name="acctProfile" />
<view-state id="showAccount" view="randomView" model="acctProfile">
<on-entry>
<evaluate expression="SomExpression"/>
</on-entry>
<transition on="SomeEvent" to="NextState"/>
</view-state>
<view-state id="NextState" view="SomeRandomView" model="acctProfile">
<on-entry>
<evaluate expression="controller.Method(acctProfile)" result="viewScope.profileForm"/> …Run Code Online (Sandbox Code Playgroud) 我有一个表格列,里面有多个div,以适合图标,标题和说明文字.此外,鼠标悬停时,我需要提供突出显示/叠加效果,突出显示所有列,包括div图像,标题和说明文本.
这是HTML
<td>
<div style="display:inline-block; border:1px solid red">left</div>
<div style="display:inline-block">
<div style="display:inline-block; border:1px solid blue">top left</div>
<div style="display:inline-block; border:1px solid green">top right</div>
<div>bottom </div>
</div>
</td>
Run Code Online (Sandbox Code Playgroud)
当我使用简单的CSS效果更改列的背景时,效果仅显示在单个div上,而不显示在整个表列上.我希望如果任何div鼠标悬停,则应突出显示所有列.
CSS代码
#MyTable td :hover {
background: #cccccc;
}
Run Code Online (Sandbox Code Playgroud) jquery ×6
android ×2
datatable ×2
ajax ×1
background ×1
cookies ×1
css ×1
datatables ×1
element ×1
google-play ×1
height ×1
highlight ×1
hint ×1
hover ×1
html-table ×1
input ×1
java ×1
javascript ×1
jstl ×1
next ×1
pagination ×1
position ×1
row ×1
savestate ×1
scroll ×1
text ×1
upgrade ×1
validation ×1