2016-10-16 1 views
0

私はjQueryの初心者です。私はいくつかのテキストで動作するようにslideDown()アニメーションを取得することができました。ただし、テキストにリンク(絶対または相対)を追加すると、ページに表示されなくなります。私は間違って何をしていますか?ありがとうございました!!jQuery slideDown()テキストが含まれているときに動作しません<a href>

<!DOCTYPE html> 
<html> 
<head> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> 
<title>Text Slide Animation</title> 

    <script type="text/javascript"> 
    $(document).ready(
     function() { 
      $("#slideIn").hide(); 
      $("#slideIn").html("<p> Coming off a long break after the 2014 &quot;Rebirth&quot; Album Salbakuta evolves yet again. 2016 sparked an all new birth of music and lyrics. Salbakuta (Charlie Mac, Mad Killah, and new member JawTee) brings a new flavor of music styles and beats. New producers like Mark Beats, Jawtee, and King Chase of New Dawn Music Group combine with Salbakuta&apos;s infectious lyrics have verified the return of this legendary Hip Hop group. </p> <p>Salbakuta has just released 3 new music videos on YouTube, (&quot;Biko&quot; Binibini Ko), (Wag iba ako nalang) and PinoyMyx (Wag kang Bitter). A small taste of the new album will be released soon on ITunes, Spotify, etc. It will be followed up with a full album under New Dawn Music Group, so standby for release dates. </p> <p>Salbakuta is now headlining shows and performing small concerts in preparation for the new album. You can catch them doing guest appearances on your local radio and TV stations. For more info on upcoming shows, events, and bookings <a href="#touch">get in touch</a> with us below.</p> <p>Salbakuta is a <b>New Dawn Music Group</b> artist</p>").slideDown('slow'); 
    }); 
</script> 


</head> 


<body> 

<div id="slideIn"></div> 

<p id="touch">Get In Touch</p> 

</body> 




</html> 
+1

OK - 私はhrefの宛先の周りにシングルの代わりに二重引用符を使用しました。数字私はそれを把握する前に私はここで質問をするだろう。まあ、多分これは他の誰かを助けるでしょう:P –

+0

Plzあなたの質問への回答を追加して、他の人が簡単に解決策を見つけるかもしれない – rafaelcastrocouto

答えて

0

あなたは.html()方法であなたのHTMLコンテンツのための二重引用符を使用しているので、<a href=のための単一引用符を使用します。

<a href='#touch'> 
-2

代わり.appendを使用#slideInにコンテンツを追加するための.htmlを使用したのと#slideInセレクタで.slideDown seperatlyを使用してください。

関連する問題