locked
jquery css issue in windows app

    Question

  • I am trying apply css to an element using jquery as shown below:
                                    $('.notapNewBook').css('background','url(app/widgets/BookC/images/newbook-small-on.png)');
    
    Does jquery css supported in windows or what is the issue with this?
    Tuesday, May 20, 2014 3:50 PM

Answers

  • Hi ranik412,

    JQuery 2.0+ version is supported by Windows Store App.

    I test with your code and works fine, I can see the background has been modified to my own image.

        <script src="/js/jquery-2.1.1.min.js"></script> 
        <style>
            .notapNewBook{
                width:500px;
                height:500px;
            }
        </style>
    
        <script>
            function buttonClick()
            {
                $('.notapNewBook').css('background', 'url(../images/1.jpg)');
            }
        </script>
    </head>
    <body>
        <p class="notapNewBook">Content goes here</p>
        <button onclick="buttonClick()">click me</button>
    </body>
    </html>

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, May 21, 2014 1:46 AM
    Moderator