我的目标slideToggle() div需要display:inline-block而不是display:block它打开时.有没有办法在这里改变jquery行为?
编辑:
我目前正在使用jQuery 1.7.0.此外,<div>最初是在display:none并且应该display:inline-block在点击链接后扩展到; 但显然这种情况下slideToggle()的默认状态是display:block......
每当用户点击文件夹旁边的[+]时,我就会通过json_data加载我的jsTree.我想要做的是将css类应用于某些节点,以便为用户突出显示它们.这里不是关于鼠标悬停或当前选择的节点,而是一些人类必须稍后查看的多个节点.适当的css类已经在服务器的JSON响应中:
[
{"attr":{"id":"node_5","rel":"document","page_id":"4"},"data":"Test123","csscl":"ui-state-error","state":""},
{"attr":{"id":"node_6","rel":"folder","page_id":"6"},"data":"Services","csscl":"","state":"closed"}
]
Run Code Online (Sandbox Code Playgroud)
我的"Test123"节点应该在树后面获得类"ui-state-error".这是我的jsTree:
$(function () {
// Settings up the tree. note to self: dont use the cookie plugin here, this will always overwrite pre-selected nodes
$("#jstree").jstree({
"plugins" : [ "themes", "json_data", "ui", "types", "hotkeys",],
"json_data" : {
"ajax" : {
"url" : "inc/tree_server.php",
"data" : function (n) {
return {
"operation" : "get_children",
"id" : n.attr ? n.attr("id").replace("node_","") : 1
};
},
success: function(n) {
for (var i in n)
{
jqid = "#"+n[i].attr["id"]+" a";
$(jqid).addClass(n[i].csscl); …Run Code Online (Sandbox Code Playgroud) 我想知道CSS3中是否有任何方式可以指向已经显示在浏览器中的同一页面的链接 - 例如,在导航中突出显示红色,告诉用户"你现在就在这里!" 因为我有很少的链接列表,我希望有些用户可能会逐个读取它们.
因此,如果浏览器处于/features/feature3.php,那么显然我想改变具有相同href目的地的所有链接的外观.
似乎只有:hover,:focus和:active,但没有什么可以纯粹在CSS中解决这个问题.我错过了什么吗?