What is up with this animate function?
I used
this tut to make a horizontal accordion.. but are trying to extend it to hide and show content like
this example..(click the black "knowledge" box and the sample will slide up)
but eventho the setup should be the same for expanding and opasity there is a opasity "blink" when hover over the expanded element but no collapsing. So the espanding/collapsing setup works, but not the Opasity part?
is it a var delaration issue?
- <script type="text/javascript" >
- $(document).ready(function(){
- var lastBlock = $("#a1");
- var kid = $("#a1").children(".kid");
- var maxWidth = 210;
- var minWidth = 60;
- $("ul li a").hover(
- function(){
-
- $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
- $(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
- $(kid).animate({opacity: 0},100);
- $(this).children(".kid").animate({opacity: 1},500);
- kid = $(this).children(".kid")
- lastBlock = this;
-
- }
- );
- });
The HTML part
- <ul>
- <li>
- <a id="a1">
- <div class="ARCCtitle">KNOWLEDGE</div>
- <div class="kid">The foundation of our Design is knowledge. The more a strategy is qualified by knowledge of the subject, the greater are the creative freedom. </div>
- </a>
- </li>
- <li>
- <a>
- <div class="ARCCtitle">RESEARCH</div>
- <div class="kid">Our research is fundamental.
- We need to know you to make functional design
- </div>
- </a>
- </li>
- <li>
- <a>
- <div class="ARCCtitle">WORKSHOPS</div>
- <div class="kid">Engage users its going to be theres design
- </div>
- </a>
- </li>
- <li>
- <a>
- <div class="ARCCtitle">SURVEYS</div>
- <div class="kid">We are building our surveys on the specific human environment and from our social knowledge
- </div>
- </a>
- </li>
- <img src="image/spids.png" alt="spids" width="60" height="220"/>
- </ul>
- </div>
And the CSS
- ul{
- list-style: none;
- margin: 0;
- padding: 0;
- }
- li{
- cursor: pointer;
- }
- ul li{
- background-color: black;
- display:block;
- float:left;
- margin-left:10px;
- padding:10px;
- }
- ul li a{
- display: block;
- overflow: hidden;
- height: 200px;
- width: 60px;
- }
- #a1{
- width: 210px;
- }
- .kid{
- font-size: 1.1em;
- margin: 0;
- padding-top: 5px;
- display: block;
- opacity: 0;
- filter: alpha(opacity=0);
- -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
- }
- #a1 .kid{
- opacity: 1;
- filter: alpha(opacity=100);
- -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
- }
- ul li img{
- position: absolute;
- }