Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果使用jQuery设置对象动画,虚线边框将变为实心_Jquery_Border - Fatal编程技术网

如果使用jQuery设置对象动画,虚线边框将变为实心

如果使用jQuery设置对象动画,虚线边框将变为实心,jquery,border,Jquery,Border,我有一个简单的设置:先是一张图片,然后是一段带有隐藏信息的段落,然后鼠标悬停在图片上向上滑动。如果我尝试在段落上应用虚线或虚线的边框顶部,它只会变成一条实线。这是一个已知的修复问题吗?我甚至尝试通过jQuery添加虚线边框,但结果仍然是实线 HTML: JS: 无法复制您描述的内容(使用Opera) 检查这个简单的演示页面 请提供重现您的问题的工作样本。并包括您使用的浏览器的信息 顺便说一句,您是否知道您将背景色和边框颜色设置为相同的颜色代码?尝试更改边框顶部:3px虚线#8d9c0c到例如边框

我有一个简单的设置:先是一张图片,然后是一段带有隐藏信息的段落,然后鼠标悬停在图片上向上滑动。如果我尝试在段落上应用虚线或虚线的边框顶部,它只会变成一条实线。这是一个已知的修复问题吗?我甚至尝试通过jQuery添加虚线边框,但结果仍然是实线

HTML:

JS:


无法复制您描述的内容(使用Opera)

检查这个简单的演示页面

请提供重现您的问题的工作样本。并包括您使用的浏览器的信息


顺便说一句,您是否知道您将
背景色
边框颜色
设置为相同的颜色代码?尝试更改
边框顶部:3px虚线#8d9c0c到例如
边框顶部:3个点#FF0066

我认为“border top”不适合动画。我知道,要在动画中设置边框宽度,必须使用
borderWidth
而不是
borderWidth
。因此,请尝试使用同样的方法。希望它能有所帮助:)

如果您使用jquery ui,borderTop确实可以工作,但您需要将其更改为“borderTop”。遗憾的是,我发现你必须定义每一个边界

$(this).stop().animate({
    backgroundColor: "#000",
    borderRightColor: "#09c",
    borderLeftColor: "#09c",
    borderTopColor: "#09c",
    borderBottomColor: "#09c"
}, "slow");

你能提供代码和CSS吗?你也能发布你的jQuery代码吗(通过编辑你的帖子)?是的,看,最初我想有一个1像素的虚线边框,与背景颜色相同,作为一个小装饰。我确实试着把它变成黑色,但仍然得到了同样的结果。
.wrap .info {
    width:204px;
    height:50px;
    background:url(images/infobg.jpg) repeat-x #8d9c0c;
    color:#f7f5ef;
    padding:3px;
    position:absolute;
    top:142px;
    left:0;
    border-top:3px dotted #8d9c0c;
}
$(document).ready(function(){
$("p.info").css("border-top","3px dotted #8d9c0c");
$(function(){
   bindTypeOne();
   $("input[type=radio]").click(function(){
      if ($(this).attr("rel") == "type1"){
         bindTypeOne();
      } else if ($(this).attr("rel") == "type2"){
         bindTypeTwo();
      }
   });
});

function bindTypeOne() { 
 $("div.wrap").hover(function(){
    $(this).children("p.info").stop();
    $(this).children(".front").stop().animate({"top":"141px"}, 400);        
   },function(){
    $(this).children("p.info").stop();
    $(this).children(".front").stop().animate({"top":"0"}, 700);
 });
};

function bindTypeTwo() {
  $("div.wrap").hover(function(){
   $(this).children(".front").stop();
   $(this).children("p.info").stop().animate({"top":"80px","border-top":"3px dotted #8d9c0c"}, 400);        
  },function(){
   $(this).children(".front").stop();
   $(this).children("p.info").stop().animate({"top":"142px"}, 700);
  });
};

});
$(this).stop().animate({
    backgroundColor: "#000",
    borderRightColor: "#09c",
    borderLeftColor: "#09c",
    borderTopColor: "#09c",
    borderBottomColor: "#09c"
}, "slow");