I was looking for my specific problem and cannot find it ... I hope one of you can help.
I am trying to get nth-child to work in IE - now I read that you can do it with jquery, how can I implement jquery in this instance?
I also use this lib element ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js
It works fine in Firefox, but not IE - please help - thanks
<div class="info-col">
<h2>Header 1</h2>
<a class="imagehref="imagepath">View Image</a>
<dl>
<dt>Sub header 1</dt>
<dd>Copy 1.</dd>
<dt>Sub header 2</dt>
<dd>Copy2</dd>
<dt>Sub header 3</dt>
<dd>Copy 3</dd>
<dt>Sub header 4</dt>
<dd>Copy 4</dd>
<dt>Sub header 5</dt>
<dd>Copy 5</dd>
<dt>Sub header 6</dt>
<dd>Copy 6</dd>
</dl>
</div>
Javascript Code
$(function() {
var $el, $parentWrap, $otherWrap,
$allTitles = $("dt").css({
padding: 5,
"cursor": "pointer"
}),
$allCells = $("dd").css({
position: "relative",
top: -1,
left: 0,
display: "none"
});
$("#page-wrap").delegate("a.image","click", function(e) {
if ( !$(this).parent().hasClass("curCol") ) {
e.preventDefault();
$(this).next().find('dt:first').click();
}
});
$("#page-wrap").delegate("dt", "click", function() {
$el = $(this);
if (!$el.hasClass("current")) {
$parentWrap = $el.parent().parent();
$otherWraps = $(".info-col").not($parentWrap);
$allTitles = $("dt").not(this);
$allCells.slideUp();
$allTitles.animate({
fontSize: "14px",
paddingTop: 5,
paddingRight: 5,
paddingBottom: 5,
paddingLeft: 5
});
$el.animate({
"font-size": "20px",
paddingTop: 10,
paddingRight: 5,
paddingBottom: 0,
paddingLeft: 10
}).next().slideDown();
$parentWrap.animate({
width: 320
}).addClass("curCol");
$otherWraps.animate({
width: 140
}).removeClass("curCol");
$allTitles.removeClass("current");
$el.addClass("current");
}
});
$("#starter").trigger("click");
});
source
share