treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] CSS or HTML?

  • I'm having a difficult time trying to determine whether something is controlled by CSS or HTML. I've been using Firebug and I'm 95% sure that what I'm looking at is an inline HTML style.

    My navigation bar, located here:
    http://www.nintendonerds.com/forums/

    ...has a button at the end (magnifying glass) that shows/ hides a search bar. I personally dislike that and I want it to always show. By default, it's hidden unless that magnifying glass button is clicked on.

    I tried changing "display:none" to "display: inline-block" for the #search ID but something is controlling that to where it's still hidden by default.

    Am I overlooking something simple here, or does this go beyond CSS or HTML?

    Any help is greatly appreciated.


    Thanks,
    Kevin
  • In your MAIN.JS file, comment this section out:


    // Show & Hide: Search
    $("#search").hide();
    $('.jq_show_search').click(function() {
    $('#search').fadeOut('fast');
    });
    $('.jq_show_search').click(function(event){
    if(!$('#search').is(":visible")) {
    $('#search').stop().fadeIn('fast');
    $('#search').css('visibility','visible');
    }
    return false;
    event.stopPropagation();
    });
    Or, if you want keep the functionality of making the form show and hide but just want to make it show by default, just comment out this first line (it's what causing it to be invisible on page load):

    $("#search").hide();
  • The show/hide is being controlled by javascript.

    Line 37 from main.js:
        // Show & Hide: Search
    $("#search").hide();
    $('.jq_show_search').click(function() {
    $('#search').fadeOut('fast');
    });
    $('.jq_show_search').click(function(event){
    if(!$('#search').is(":visible")) {
    $('#search').stop().fadeIn('fast');
    $('#search').css('visibility','visible');
    }
    return false;
    event.stopPropagation();
    });

    Beaten to it!
  • Deja vu? Echo....? ;)
  • Thank you very much, everyone! I completely forgot about this discussion.