2015-11-13 142 views
0

嘿家伙我这里有这段代码一切似乎工作正常,除了一个问题... 我有aj查询移动弹出按钮的代码,它不工作作为一个按钮,它实际上甚至没有运作在所有 这是我的scripiting? 还是这是干扰我的背景?jquery移动按钮

我也试图CDN jQuery的脚本和jQuery Mobile的剧本,但后来我谷歌浏览器永远给我一个负重轮,并且不显示任何的jQuery的东西

<!DOCTYPE html> 
<html> 
<head> 


<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" href="jquery.mobile-1.4.5.css"> 
<script src="jquery.js"></script> 
<script src="jquery.mobile-1.4.5.js"></script> 
<style> 

    body { 

    background-image: url(myhostedwebsiteurl.jpeg); 


    background-position: center center; 


    background-repeat: no-repeat; 

    background-attachment: fixed; 


    background-size: cover; 


    background-color: #464646; 
} 
</style> 

<link rel="stylesheet" type="text/csc" href="additionbutton.css"/> 

</head> 
<body> 


<div data-role="page" id="pageone"> 
    <div data-role="header"> 
<br> 
<br> 
<br> 
<br> 
<br> 
    <h1 style="text-align:center"> <font face="comic sans ms" color= #F781F3><b> <marquee> blah blah</marquee></b></h1> 
    </div> 

<div data-role="main" class="ui-content"> 


<a href="#myPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all">About the Game</a> 

    <div data-role="popup" id="myPopup"> 
    <p>text goes here but its not working </p> 
    </div> 
+0

使用自举:[小提琴](http://jsfiddle.net/oLxxz9h4/3/) – Raviteja

回答

0

您的代码似乎是正确的,但不是很干净 - 但这并不重要。

我只是复制并粘贴你的代码片段来测试它和它的作品如预期,看到这个fiddle

只要确定,该脚本文件被正确加载,你有正确的jQuery的版本(目前1.11.1 jQuery Mobile的兼容性)。

要使用的所有脚本从CDN中,在正是这种为了把这个在你的脑袋:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> 
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> 
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> 
0

我还测试了你的代码,使用jQuery 2.1.3的最新版本一起,和最新的JQuery手机的CDN:http://jsfiddle.net/Twisty/1v946soo/

包括一些代码修复和清理:

<div data-role="page" id="pageone"> 
    <div data-role="header"> 
     <br /> 
     <br /> 
     <br /> 
     <br /> 
     <br /> 
     <h1 style="text-align:center"> 
      <font face="comic sans ms" color= #F781F3> 
       <b> 
        <marquee> blah blah</marquee> 
       </b> 
      </font> 
     </h1> 
    </div> 
    <div data-role="main" class="ui-content"> 
     <a href="#myPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all">About the Game</a> 
     <div data-role="popup" id="myPopup"> 
      <p>text goes here but its not working</p> 
      <br /> 
      <p>Test</p> 
     </div> 
    </div> 
</div> 

如果这仍是不适合你的工作,请提供更多的细节。包括您与测试浏览器版本,如果任何出现在控制台什么错误,就需要采取复制问题什么步骤。