The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Code Errors Help

    Asriel
    Asriel
    Forumember


    Male Posts : 585
    Reputation : 32
    Language : English, Russian, Ukrainian
    Location : St. Somewhere

    Solved Code Errors Help

    Post by Asriel March 4th 2013, 4:41 am

    OK, so I am building a shop and I got code and all. Everything works beautifully, but I am struggling with aligning the items.

    Here's my shop code.

    Code:

    .header{color:#FA8805;font-size:54px;text-align:center;text-shadow:4px 3px 4px #000000;height:40px;padding-bottom:40px; font-family: Comic MS}
    .shopWrapper{text-align:center;margin:0 auto;border: 2px solid silver;overflow:hidden;height:auto;background: url(http://www.tofuhaus.com/images/2013/01/pattern-black-478180.jpg);}
    .title{color:#000;font-size:12px;}
    .image img{height:64px;width:64px;}
    .image{text-align:center;}
    .points{color:green;font-size:8px;float:left;text-align:center;}
    .sale{color:#ff0000;font-size:8px;float:right;text-align:center;}
    .item{width:130px;min-height:150px;border:1px solid #000;overflow:hidden;height:auto;padding:5px;background:#fff;text-align:center;}
    .descrip{background:#E9D09B;overflow:hidden;height:auto;min-height: 50px;}
    .description {color: black;font-size: 10px;word-wrap: break-word;text-align: left !important;float: left;text-indent: 5px;}
    .itemWrapper{text-align:center;margin:0 auto;float:left;}
    .inventWrapper{float:left;width:600px;height:auto;overflow:hidden;}
    .cart{overflow: hidden;background: white;}
    .cart_title{text-align:center;color: green;border-bottom:2px solid #000;}
    .cart_items{text-align:center; color: black}
    .cart_body{text-align: center;
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: scroll;
    border: 3px double orange;
    height: 600px;
    background: white;}
    .cartWrapper{float:right;width:156px;}
    .totaler{bottom:0; color: black}
    li:hover{cursor:pointer;}
    #checkout{float: left;
    height: 100px;
    text-align: center;
    background: orange;
    border-top: 3px solid orange;
    margin-top: 5px;
    width: 100% !important;}



    [img]http://i.imgur.com/moKxryc.png[/img]






    1000 Credits

    [img]http://cdn1.iconfinder.com/data/icons/ecommerce-and-business-icon-set/64/money.png[/img]

    100 credits
    Need more credits? For just 100 coins you can have 1000 more. You know you need it.






    Power Enhancement

    [img]http://images4.wikia.nocookie.net/__cb20110618002958/sims/images/1/11/Potion_Mood_Enhancer.png[/img]

    150 credits


    Increase your character's powers by 1 ATK & 1 DEF
       
     


    Invisibility Cloak

    [img]http://images.creatureworld.net/items/male_wizard_cloak.png[/img]

    300 credits2 USES
    Use this cloak to disappear from anyone.                                                                 

     



    Imortality

    [img]http://b.dryicons.com/images/icon_sets/valentine_love/png/64x64/ribbon_heart.png[/img]

    10,000 credits1 PER ACCOUNT
    The chosen one shall be immortal
       



    Medallion of Life

    [img]http://wiki.guildwars.com/images/0/0d/Token_of_Janthir.png[/img]

    1000 credits1 USE
    Give your or someone else's character second chance at life
       



    Custom Rank

    [img]http://tacticalinsertion.weebly.com/uploads/4/4/8/3/4483126/4517240.png?64[/img]


    1500 credits2 PER ACCOUNT
    Custom ranks for your characters
       



    Elimination

    [img]http://evooffers.com/images/icons/target.png[/img]


    5000 credits
    With this item you can destroy any character forever.
       



    Portal Staff

    [img]http://wiki.guildwars.com/images/a/ae/Portal_Staff.png[/img]


    1500 credits2 USES
    Teleport any character to any location you desire.
       



    Smoke Bomb

    [img]http://cdn.wikimg.net/strategywiki/images/f/f0/CoDMW2_Emblem_Grenade_Kill_III.png[/img]

    1500 creditsMAX 12

    Supply of 12 smoke bombs.
       

       
       



    Shopping Cart

    [list]

    [/list]
          Total Credits =
       

    Would you like to check out now? If so, just click the 'Update Card' button then 'Send'. Allow 24 hours for all the items to be processed.










    (function(jQuery){
    jQuery(document).ready(function(){
    var jQuerytotal = 0.0

    jQuery('.addButton').click(function (){
        var theID ='#'  jQuery(this).attr('data-item');
    var pointstoAdd = parseFloat(jQuery(theID).find('.points').attr('data-myprice'));
    jQuerytotal  = pointstoAdd;
    jQuery('.totaler').html('Total Credits = '  jQuerytotal.toFixed(2));
    var jQuerynewItem = '<li class="cart-item" data-points="'  pointstoAdd '">'  jQuery(theID).find('.title').text()  '</li>';
    jQuery('.theList').append(jQuerynewItem);
    BindIt();
    });

    function BindIt(){
     
        jQuery('.cart-item').unbind('click');
     
        jQuery('.cart-item').click( function(){
            jQuerytotal -= parseFloat(jQuery(this).attr('data-points'));
            jQuery('.totaler').html('Total Credits = '  jQuerytotal.toFixed(2));
            jQuery(this).remove();
        });
    }
    });
     jQuery(document).ready(
                  function() {
                    jQuery('#submitCart').click(function() {
                    var text = '';
    var total = 0;

    jQuery(".theList li").each(function () {
      var string = jQuery(this).text();
      var points = parseInt(jQuery(this).data('points'));

      //capitalize first letter of string
      text  = string.charAt(0).toUpperCase()  string.slice(1)
      //add line break at the end
            ' = '  points  "\n";

      total  = points;
    });

    //I think calculating total is easier than trying to manipulate jQuery(".totaler")
    text  = "Total Credits = "  total;
    jQuery("#cartMessage").text(text);
                });
            });
    })(jQuery);

    and here's the screenshot of my shop.

    Code Errors Help 4e3Lie7

    I think I might be missing few
    tags but I am not sure where. Any help would be much appreciated.


    EDIT: I have fixed the problem. Thank you, CJ. This topic is COMPLETE.


    Last edited by Asriel on March 5th 2013, 3:02 am; edited 1 time in total
    Sir Chivas™
    Sir Chivas™
    Helper
    Helper


    Male Posts : 6980
    Reputation : 457
    Language : EN, FR, ES
    Location : || CSS || HTML || Graphics Designs || Support ||

    Solved Re: Code Errors Help

    Post by Sir Chivas™ March 4th 2013, 4:52 am

    I've notice that this only happens when you place the Header and Footer, I will play around with the HTML. Wink

    This might take a while. Razz
    Asriel
    Asriel
    Forumember


    Male Posts : 585
    Reputation : 32
    Language : English, Russian, Ukrainian
    Location : St. Somewhere

    Solved Re: Code Errors Help

    Post by Asriel March 4th 2013, 5:05 am

    That's ok. Thanks CJ.
    Jophy
    Jophy
    ForumGuru


    Male Posts : 17922
    Reputation : 836
    Language : English
    Location : Somewhere

    Solved Re: Code Errors Help

    Post by Jophy March 9th 2013, 8:13 am

    Since the topic was marked complete, I will consider this as solved and mark it now.

    Topic Solved & Locked

      Current date/time is September 22nd 2024, 9:32 pm