第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

選擇警報框選項時頁面跳轉(zhuǎn)

選擇警報框選項時頁面跳轉(zhuǎn)

函數(shù)式編程 2021-05-11 21:31:20
我希望根據(jù)用戶在警報框中的選擇,將用戶頁面跳轉(zhuǎn)到我網(wǎng)站的已定位部分。當警報框彈出時,如果他們確認自己擁有iPhone(這只是信息性的,設(shè)備確實沒有關(guān)系),則應(yīng)說“很酷”并留在原處,因為iPhone信息從頂部開始。但是,如果它們?nèi)∠?,我希望它們被頁面跳轉(zhuǎn)到Android信息開始的頁面底部。我一直在瀏覽堆棧溢出和其他各種站點,但是找不到解決該問題的方法,但是如果我錯了,請原諒。<!--the Javascript function -->function Question() {var x=window.confirm("You have an iPhone right???")if (x)window.alert("Good!")elsewindow.alert("Here is info for your device type!")}<!-- the html im looking to jump to --><h2 id = galaxyInt><a id = "SamsungStart">Samsung Galaxy Mobile Security</a></h2>我希望不單擊警報框確認,否則else語句會將用戶從頁面跳到正確的部分。
查看完整描述

1 回答

?
藍山帝景

TA貢獻1843條經(jīng)驗 獲得超7個贊

使用window.location.href =“ #SamsungStart”; 鏈接到您要訪問的ID。


<!--the Javascript function -->


function Question() {

var x=window.confirm("You have an iPhone right???")

if (x)

window.alert("Good!")

else

window.location.href = "#SamsungStart";

}

Question();

#top{

width:100%;

height:300px;

float:left;

background-color:blue;

}

.container2{

width:100%;

height:400px;

float:left;

background-color:green;


}

#galaxyInt{

width:100%;

float:left;


}

#SamsungStart{

width:100%;

float:left;

}

<!-- the html im looking to jump to -->


<div id = "top"></div>




<div class="container2">

<h2 id = "galaxyInt"><a id = "SamsungStart">Samsung Galaxy Mobile 

Security</a></h2></div>


查看完整回答
反對 回復(fù) 2021-05-27
  • 1 回答
  • 0 關(guān)注
  • 190 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號