我有一個fullScreen()
函數,該函數通過將div的CSS左屬性操作爲0或-100%,可用於Chrome和Microsoft Edge。這裏是jQuery的:.animate()或.click()函數在Firefox中不起作用
var fullScreen = function() {
$('#fullscreenbutton').click(function() {
$('.dashboard').animate({
left: "-100%"
}, 200);
});
$('#hamburgerbutton').click(function() {
$('.dashboard').animate({
left: "0"
}, 200);
});
}
HTML:
<div class="wrapper">
<div class="dashboard">
<div class="navtools">
<ul>
<li id="searchli">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1"><span class=" glyphicon glyphicon-search" aria-hidden="true" style="font-size: 22px;"></span></span>
<input type="text" class="form-control" placeholder="Search..." aria-describedby="basic-addon1">
</div>
</li>
<li id="findmebutton"><span class=" glyphicon glyphicon-globe" aria-hidden="true" style="font-size: 22px;"></span> <p>Find Me</p></li>
<li><span class="glyphicon glyphicon-star" aria-hidden="true" style="font-size: 22px;"></span> <p>Favorite</p></li>
<li><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true" style="font-size: 22px;"></span> <%= link_to ' Back ', root_path, :class => 'none' %> </li>
<li id="fullscreenbutton"><span class="glyphicon glyphicon-fullscreen" aria-hidden="true" style="font-size: 22px;color: #2A83C6"></span> <p>Full Screen</p></li>
</ul>
</div>
</div>
<div id='myMap' oncontextmenu="return false">
<div class="hamburgerbutton">
<span class="glyphicon glyphicon-menu-hamburger" id="hamburgerbutton" aria-hidden="true" style="font-size: 50px;"></span>
</div>
<div class="alert alert-info">
<a href="#" class="close" style="padding-left: 10px" data-dismiss="alert" aria-label="close">×</a>
<strong>Hey!</strong> Right-click or hold to add a location.
</div>
</div>
</div>
在正確的方向任何建議或點?
是誰喊'fullScreen' –
對不起阿朗,我對這個問題感到困惑。任何用戶在點擊「#fullscreenbutton」時都會調用fullScreen,它只是一個li項目。單擊li項時,絕對定位在Bing地圖上的.dashboard div會在屏幕外向左移動-100%(在Chrome和IE上)。然後,將儀表板重新放回到屏幕上,用戶點擊#hamburgerbutton,我相信這只是一個圖像,我放置在必應地圖的絕對位置左上角。 – alecs36
我在原始問題中包含了HTML。 – alecs36