Viele,

>> http://gmarwaha.com/jquery/jcarousellite/test/testDefault.html .
>> Here, i dont have that kind of setup. Here, the carousel should
>> unobstrusively display all the elements based on what your css style
>> rules are... In my case, i don't have any style rules except for the
>> browser default. Thanks for the feedback though. I love feedbacks.
>
>Yes, this is right. I wonder why you not write the Buttons with JS. What
>do the user without JS with this buttons?

My preference is to embed the buttons via JS, but hide them via CSS. Then
when you attach the click behavior, you also show them:

<style>
.hidden {
        display: none;
}
</style>

<script>
$("#btnClickMe")
        .bind(
                "click",
                function (){
                        alert("I've been clicked!");
                }
        )
        .show();
</script>

<input 
        type="button" 
        value="Click Me" 
        id="btnClickMe" 
        class="hidden" />

The other benefit to this type of technique is that if you have lots of
elements on the page that you want to hide if JS is disabled, you can do
something like:

<style>
.noJavaScript {
        display: none;
}
</style>

<script>
$(document).ready(function (){
        // if JS is enabled, the makes sure to remove the hide classe
        $(".noJavaScript").removeClass("noJavaScript");
});
</script>

It much easier to visualize the DOM when all the elements you want are
embedded in the HTML, instead of adding them dynamically via JS.

-Dan

Reply via email to