2012-01-04 10 views

答えて

0

は、グローバル変数へのmarqueオブジェクトを割り当てる試してみて、それに開始/停止トリガします。

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <script src="jquery-1.7.1.min.js" type="text/javascript"></script> 
    <script src="jquery.marquee.js" type="text/javascript"></script> 
    <script> 
    var marque; 
    $(function() { 

     marque= $('div.demo marquee').marquee('pointer'); 
    }); 

    function startmqr() { 
     $(marque).trigger('start'); 
    } 
    function stop() { 
     $(marque).trigger('stop'); 
    } 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div class="demo"> 
     <h2> 
      Vanilla</h2> 
     <pre><code>&lt;marquee behavior="scroll" scrollamount="1" direction="left" width="350"&gt;</code></pre> 
     <marquee behavior="scroll" direction="left" scrollamount="2" width="350"><p>START Lorem ipsum dolor sit amet END</p></marquee> 
    </div> 
    <input id="Button1" type="button" value="start" onclick="startmqr()" /> 
    <input id="Button2" type="button" value="stop" onclick="stop()" /> 
    </form> 
</body> 
</html> 

よろしく

関連する問題