最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

resize div zoom in zoom out using pure javascript or jquery - Stack Overflow

programmeradmin1浏览0评论

i have a page displaying a swf game within a div container

i need to add a zoom in zoom out slider to this page so user can resize the swf file using a slider

an example like this page slider :

like this page .html

any help please

Thanks on advance

i have a page displaying a swf game within a div container

i need to add a zoom in zoom out slider to this page so user can resize the swf file using a slider

an example like this page slider :

like this page http://www.agame./game/Snowflake-Puzzle.html

any help please

Thanks on advance

Share Improve this question edited May 21, 2019 at 16:05 Glorfindel 22.7k13 gold badges89 silver badges118 bronze badges asked Dec 17, 2009 at 4:45 EzzDevEzzDev 10.2k12 gold badges37 silver badges35 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Did you look at the source? the answer is right there:

<script type="text/javascript">
<!--
    var startGameWidth = 700;
    var startGameHeight = 550;
    var startMainContentWidth = $('div#maincontent').width();
    var startBlueboxMiddleWidth = $('div.bluebox:first div.top div.middle').width();

    function zoomObject(pos,slider){
        var newWidth = Math.ceil( pos*startGameWidth/100 );
        var newHeight = Math.ceil( pos*startGameHeight/100 );

        if( newWidth < startBlueboxMiddleWidth ) {
            $('div#maincontent, div.bluebox:first').css({'width': startMainContentWidth+'px'});
            $('div.bluebox:first div.middle').css({'width': startBlueboxMiddleWidth+'px'});
        } else {
            $('div#maincontent, div.bluebox:first').css({'width': (newWidth+30)+'px'});
            $('div.bluebox:first div.middle').css({'width': (newWidth)+'px'});
        }

        $("#flashobj").css({'width': newWidth+'px','height': newHeight+'px'});
    }
-->
</script>
发布评论

评论列表(0)

  1. 暂无评论