隐藏的滑动div出现在链接后面

时间:2015-05-30 10:46:58

标签: javascript jquery html css

fiddle

请看上面的小提琴。

有一个链接,当点击隐藏的div从右侧滑出时。

隐藏的div包含图像。

此时隐藏的div滑出,但显示距离“联系人”的距离很远。链接,然后当它向后滑动时,它会在它向后滑动之前消失并且联系起来。

我希望它可以在“联系人”背后滑出。并且回到后面'联系'没有任何重叠。

$('#contact').click(function () {
$('#contact-info').animate({width: 'toggle'});
});

3 个答案:

答案 0 :(得分:0)

你可以这样做:

var move = 80;
$('#contact').click(function () {
         move = move===80 ? 160 : 80;
    $('#contact-info').animate({right: move, width: 'toggle' });
});

检查Fiddle

答案 1 :(得分:0)

也为class MoneyTextBox : TextBox { public override string Text { set { base.Text = value; } get { return skipComma(base.Text); } } public string skipComma(string str) { string strnew = ""; if (str == "") { strnew = "0"; } else { strnew = str.Replace(",", String.Empty); } return strnew; } protected override void OnTextChanged(EventArgs e) { if (base.Text == "") { this.Text = "0"; } else { if (this.Text != "") { double d; if (!Double.TryParse(this.Text, out d)) { this.Text = null; return; } if (d == 0) { this.Text = "0"; } else this.Text = d.ToString("#,#", System.Globalization.CultureInfo.InvariantCulture); } } this.Select(this.TextLength, 0); } protected override void OnKeyPress(KeyPressEventArgs e) { if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8) { e.Handled = true; } base.OnKeyPress(e); } protected override void OnKeyDown(KeyEventArgs e) { if (e.Control & e.KeyCode == Keys.A) this.SelectAll(); base.OnKeyDown(e); } } 属性设置动画。

right

http://jsfiddle.net/RichAyotte/cs23vzjv/1/

答案 2 :(得分:0)

我通过简单地调整css找到了一种方法。 fiddle

#contact {
background-color: #ffffff;
bottom: 34px;
padding-right: 38px;
position: fixed;
right: 0;
z-index: 1;
}
#contact-info {
bottom: 34px;
margin-right: -250px;
position: fixed;
right: 444px;
text-transform: lowercase;
white-space: nowrap;
 }
相关问题