Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($('#'+thisSection).children('article').length>0) {
- if($('#'+thisSection).children('article').css('display')=='none') {
- //reopen section
- thisContent=document.getElementById(thisSection).getElementsByTagName('article')[0];
- thisContent.style.display="block";
- thisContent.style.height=0;
- scissors.style.width="95%";
- thisWhite.style.width="100%";
- setTimeout(function() { thisContent.style.height=contentHeight[thisSection]; },1);
- setTimeout(function() { thisContent.className += " sectionBorder"; },250);
- }
- else {
- //close section
- thisContent=document.getElementById(thisSection).getElementsByTagName('article')[0];
- thisContent.style.height=0;
- thisWhite.style.width="0.4em";
- scissors.style.width=scissorWidth;
- setTimeout(function() { thisContent.className -= " sectionBorder"; },250);
- setTimeout(function() { thisContent.style.display="none"; },500);
- }
- }
- else {
- //open section for the first time
- $('#'+thisSection).append(data+'\r\n\t\t\t\t'+'<footer class="white"></footer>');
- thisContent=document.getElementById(thisSection).getElementsByTagName('article')[0];
- $(thisContent).wrapInner('<div />');
- contentHeight[thisSection]=(window.getComputedStyle(thisContent).getPropertyValue('height'));
- console.log('contentHeight[thisSection] = '+contentHeight[thisSection]);
- //outputs "contentHeight[thisSection] = 48px"
- thisContent.style.height=0;
- if(!scissorWidth) {
- scissorWidth=window.getComputedStyle(scissors).getPropertyValue('width');
- console.log('scissorWidth = '+scissorWidth);
- //outputs "scissorWidth = 19.2px"
- }
- scissors.style.width=scissorWidth;
- //width has been set to 0
- setTimeout(function() {
- scissors.style.width="95%";
- thisWhite.style.width="100%";
- }
- ,1);
- setTimeout(function() { thisContent.style.height=contentHeight[thisSection]; },1);
- //height has been set correctly
- setTimeout(function() { thisContent.className += " sectionBorder"; },250);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement