Results 1 to 5 of 5

Thread: How do I Hide Featured Content Glider if EMPTY

  1. #1
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default How do I Hide Featured Content Glider if EMPTY

    1) Script Title: Featured Content Glider

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tentglider.htm

    3) Describe problem: I have been pulling my hair out for 2 days trying to find a way to hide the Featured content glider if it is empty.

    I am wanting to use the script on several sites to show property which is featured but if there isn't any featured property or a featured property has expired (meaning that the glider has no content) I want to display something else instead and not receive the WARNING that the content is empty, which is very annoying.

    Basically I want to show some text or an image if there is no featured property in the mysql database or if the remotecontent file is empty.

    PLEASE SOMEONE HELP BEFORE I CRACK UP!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try finding the below two lines inside the .js file:

    Code:
    			alert("No content exists at page "+(selected+1)+"! Loading 1st page instead.")
    			selected=0
    And replace that with the following to hide the glider entirely when there is no contents to show:

    Code:
    			config.$glider.hide()
    			config.$togglerdiv.hide()
    If you want to show a message within the glider instead, replace the first line directly above with this instead:

    Code:
    			config.$glider.html('No contents to show')
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    texastez (07-20-2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Can't thank you enough for that DDADMIN I was trying allsorts to get the thing not to show if empty.

    Although this solution is fine and I am happy to leave it at that. I don't suppose you know how I could do the following with it?

    Currently the 'Featured content glider' is nested in a html table here is the code (simplified):

    <table><tr><td>
    <script type="text/javascript">
    featuredcontentglider script etc...
    </script>

    <div id="featured" class="glidecontentwrapper"></div>
    <div id="p-select" class="cssbuttonstoggler">
    <a href="#" class="prev"><span>Prev</span></a> <a href="#" class="next"><span>Next</span></a>
    </div>
    </td>
    </tr>
    </table>

    I would like to hide the whole table (possibly show another table instead) if the value in the database is false, for example:
    A value of '1' is inserted into the mysql database ('type' column) if a property is 'Standard' and a value of '2' inserted if the property is 'Featured'

    I tried all sorts of different combinations to only show the table if the value in 'type' column in database was = to 2 but couldn't get it to work.
    Tried enclosing table in <div> tags
    Tried php if statements/ if else etc
    Just can't seem to get it to work!
    Any help or a point in the right direction would be very much appreciated.

  5. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It's certainly possible, though exactly how requires more info from you. What does your database physically output to the page to indicate the relevant table's value is 1 or 2? The Glider script needs some way to know this value when the page loads so it can then either hide or show the TABLE element.
    DD Admin

  6. #5
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with Featured Content Glider

    ) Script Title: Featured Content Glider

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tentglider.htm

    3) Describe problem: Where on the HTML page or JS page for this great script can you change it to fade in and out instead of sliding l/r or t/b??

    4) And is there a place to add a hover n the buttons, or a pause and restart button?

    5) Lastly, can an array to a list of HTML files be used instead?

    Thank you very much
    Last edited by mwscrl; 08-10-2010 at 03:43 PM. Reason: forgot something

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •