Welcome Guest, Not a member yet? Register   Sign In
Mootools question
#1

[eluser]iainco[/eluser]
Hey guys, I'm using Mootools' Fx.Slide to hide some extra features on my page.

http://79.99.41.1/slide.php

Clicking the top left corner link "Rate/Comment" will reveal the extra functionality.

My only problem is that because the lower content is an iframe, as the top panel slides in, it pushes the frame down and the bottom part is cut off, most noticeable by the disappearing scroll down arrow button.

I thought one solution would be to set the footer div's height to x pixels, and then using an Fx.Morph, subtract x from the iframe height... but seems a little messy.

Here is all the code required for slide.php to work:

Code:
<?='<?'?>xml version="1.0" encoding="UTF-8"<?='?>'?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Slide&lt;/title&gt;
&lt;link rel="stylesheet"type="text/css" href="http://www.tracesport.com/beta/assets/css/article.css"&gt;
[removed][removed]
[removed][removed]
[removed]
window.addEvent('domready', function() {
    var w = 0, h = 0;
    if(typeof(window.innerWidth) == 'number') {
        w = window.innerWidth;
        h = window.innerHeight;
    }
    else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        w = document.documentElement.clientWidth;
        h = document.documentElement.clientHeight;
    }
    else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
        w = document.body.clientWidth;
        h = document.body.clientHeight;
    }
    
    $('frame').setStyle('height', h - 18);
    $$('.footer-block').setStyle('width', 0.25 * (0.6 * w));
    
    /* Slide */
    $('footer').setStyle('height','auto');
    var mySlide = new Fx.Slide('footer').hide();
    $('toggler').addEvent('click', function(e) {
        e = new Event(e);
        mySlide.toggle();
        e.stop();
    });
});    
[removed]
&lt;/head&gt;

&lt;body&gt;
    <div id="wrapper">
        <div style="height:18px;width:100%;"><a id="toggler" href="#">Rate/Comment</a></div>
        <div id="footer" style="width:100%;">
            <div style="width:60%;">
                <div class="footer-block">
                    Rate<br />
                    &lt;form id="rate" action="" method="post"&gt;
                        &lt;input type="hidden" name="articleID" value="" /&gt;
                        &lt;input id="vote" type="hidden" name="vote" /&gt;
                        &lt;input id="positive" type="submit" value="Positive" /&gt;
                        &lt;input id="negative" type="submit" value="Negative" /&gt;
                    &lt;/form&gt;
                </div>
                <div class="footer-block">
                    Archive<br />
                    &lt;form id="archive" action="" method="post"&gt;
                        &lt;input type="hidden" name="articleID" value="" /&gt;
                        &lt;input type="submit" value="Archive Save" /&gt;
                    &lt;/form&gt;
                    &lt;form id="archive" action="" method="post"&gt;
                        &lt;input type="hidden" name="articleID" value="" /&gt;
                        &lt;input type="submit" value="Archive Delete" /&gt;
                    &lt;/form&gt;        
                    &lt;form id="delete" action="" method="post"&gt;
                        &lt;input type="hidden" name="articleID" value="" /&gt;
                        &lt;input type="submit" value="Delete" /&gt;
                    &lt;/form&gt;
                </div>                
                <div class="border-r">
                    <div class="footer-block">
                        E-mail<br />
                        &lt;form id="email" action="" method="post"&gt;
                            &lt;input type="hidden" name="articleID" value="" /&gt;
                            &lt;input type="text" name="email" /&gt;
                            &lt;input type="submit" value="Submit" /&gt;
                        &lt;/form&gt;
                    </div>
                </div>
                <div class="footer-block">
                    Tag<br />
                    &lt;form id="tag" action="" method="post"&gt;
                        &lt;input type="hidden" name="articleID" value="" /&gt;
                        &lt;input type="text" name="tag" /&gt;
                        &lt;input type="submit" value="Submit" /&gt;
                    &lt;/form&gt;                    
                </div>
            </div>
            
            <div style="width:40%;">
                &lt;form id="comment" action="" method="post"&gt;
                    &lt;input type="hidden" name="articleID" value="" /&gt;
                    &lt;textarea name="comment"&gt;&lt;/textarea>
                    &lt;input type="submit" value="Submit" /&gt;
                &lt;/form&gt;    
            </div>
        </div>
        &lt;iframe id="frame" frameborder="0" width="100%" src="http://news.bbc.co.uk/sport/"&gt;&lt;/iframe>
    </div>
&lt;/body&gt;
&lt;/html&gt;

Any help much appreciated!

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB