2015-03-03 147 views
2
  1. 我正在使用按鈕position:fixed。如果我懸停鼠標,它會在滾動後不會懸停時變爲手形符號。按鈕無法正常工作

  2. 在滾動懸停之前,按鈕中心不在邊緣。

    <form action="response.php"> 
        <button style=" position:fixed;" >Get Your Result </button> 
    </form> 
    

默認位置我把鼠標放到按鈕的中心工作原理
enter image description here

相同的默認位置懸停不上按鈕的工作,即使鼠標光標enter image description here

最後我將鼠標懸停後滾動完全被禁用

enter image description here

+1

檢查http://jsfiddle.net/f2rad3cn/。 – ketan 2015-03-03 07:13:43

+0

使用遊標:指針;在你的按鈕樣式。 – user3386779 2015-03-03 07:14:08

回答

3

嘗試增加z-index屬性爲您的按鈕。
這可能是因爲滾動時,您的按鈕可能有任何其他元素重疊。
僅供參考:在z-index中,具有較高z-索引值的元素出現在前面。

+0

謝謝你,這聽起來不錯,我在我的作品中加入了'z-index:1' – Thamaraiselvam 2015-03-03 07:58:38

+0

好。樂意效勞。 – 2015-03-03 08:47:46

1

我覺得需要設置按鈕式 喜歡這個

<button type="submit" style=" position:fixed;" >Get Your Result </button>

+0

感謝回答的人 – Thamaraiselvam 2015-03-03 08:00:39

1

我想在這裏工作,你想要什麼:

<form action="response.php" style="min-height:800px;"> 
    <button style=" position:fixed; cursor:pointer;" >Get Your Result </button> 
</form> 

檢查Fiddle

+1

問題是滾動新內容時出現按鈕,因此它不起作用。但你的'光標:指針'是正確的,謝謝親愛的 – Thamaraiselvam 2015-03-03 08:00:20

1

使用Ť他

<form action="response.php"> 
    <button type="submit" style=" position:fixed;cursor:pointer;" >Get Your Result </button> 
</form> 
+0

問題是滾動新的內容來按鈕,所以它不工作。但你的'cursor:pointer'是正確的,謝謝親愛的 – Thamaraiselvam 2015-03-03 08:00:10

+1

很高興幫助你@Thamaraiselvam – 2015-03-03 08:03:05

1

您正在尋找這樣的事情:

<body> 
    <form action="response.php"> 
    <button type="button" style=" position:fixed;" >Get Your Result </button> 
    </form> 
</body> 

風格

button:hover{ 
    background-color: red; 
    cursor: pointer; 
    } 
    body{ 
    height: 2000px; 
    } 
+0

問題是滾動新內容時出現按鈕,所以它不起作用。但你的'光標:指針'是正確的,謝謝親愛的 – Thamaraiselvam 2015-03-03 08:00:05