1

URL: http://adamginther.com

画像「DragonUp」が押されたときにdivを検証し、その値が空かどうかを確認しようとしています。空の場合は、その div に段落と画像を追加します。テキストが含まれている場合は、その div を空にします。これは機能していません。検証はこれを行うための適切な方法ですか?

<div id="description"></div>
<p id="checkOut">
You should check out some of my work
</p>
</div>
<section id="portfoliopics">
<p>Information Architecture</p>
<img src="images/dragonup.png" id="dragonup" alt="DragonUp">
<img src="images/province.jpg" id="provincesports" alt="The Province Sports">
<img src="images/ayogo.jpg" id="ayogo" alt="ayogo">
<p>Design</p>
<img src="images/rebellious.png" alt="Rebellious by Nav" id="rebellious">
<img src="images/attack.png" alt="Attack of the Space Leprechauns">
<p>Development</p>
<img src="images/form.png" alt="Form Design" id="formdesign">
<img src="images/imageswap.png" alt="Image Swap">
<img src="images/popup.png" alt="Pop-up Window">
<img src="images/learningios.png" alt="Learning iOS Development" id="learningios">
<p>More Stuff</p>
<img src="images/canucks.jpg" alt="canucks">
<img src="images/saveinte.png" alt="Save Interactive Design">
</section>

$(document).ready(function() {
    $("#dragonup").click(function() {
        $('#description').val();
        if ('#description' === '') {
        $('#description').empty();
        $("#description").prepend('<p><class id="blueText">You are viewing: DragonUp Wireframes </class><br> Role: User Experience Design<br><br>DragonUp is a game created by East Side Games for iOS and it is currently being ported over to Facebook. It is a game that draws inspiration from Dragonvale and Tiny Tower and has players building up a collection of dragons. Kotaku describes it as A dragon vomit harvesting game, and that makes all the difference.<br><br>I was tasked with proposing a re-design of its UI. Currently, the game has 10 different options in the menu. With this in mind, my goal was to create a more streamlined menu for new users and more fluid navigation for experienced players. I was able to achieve this and accomplished having four different options in the menu while still containing the same functionality and increasing usability.</p>');
                $("#description").append('<img src="images/work/dragonup-wireframe1.png">');
                $("#beforeClick").remove();
                $('#checkOut').empty();
                $('#checkOut').append('You should also check out:');
            }
            else {
                $('#description').empty();
            }
    })
})
4

3 に答える 3

0

そのはず:

$('#description').html();

.val()入力用です

于 2013-05-24T14:08:16.357 に答える