PDA

View Full Version : How do I Hide Featured Content Glider if EMPTY



texastez
07-20-2010, 12:29 AM
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!

ddadmin
07-20-2010, 08:16 AM
Try finding the below two lines inside the .js file:


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:


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:


config.$glider.html('No contents to show')

texastez
07-20-2010, 12:51 PM
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.

ddadmin
07-21-2010, 06:59 AM
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.

mwscrl
08-09-2010, 10:11 PM
) 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