Help with drop down main page news?[Solved]

Javascript/css/html - Starts hidden, clicks visible, click again hidde

Page 1 of 1

5 Replies - 685 Views - Last Post: 17 June 2008 - 07:00 AM Rate Topic: -----

#1 King8654  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 120
  • Joined: 04-March 08

Help with drop down main page news?[Solved]

Posted 16 June 2008 - 04:40 PM

Hey again,

(arg hes back?? lol yes i am) On the main page of my site, freshexams.com, i have as you can see a news update from today. The site is completly written in PHP, and I may not even be in the right section, but can this news:

Quote

Update(06/16/2008) - Last week, had some pretty serious issues, and after the dust settled, most of database was deleted, including the user base. If you had an account here, please sign up again, I promise it will not happen again. Although unfortunate and stressful, this led to some new ideas and major additions to the site and a final debugging to get everything in working order! From a new search that crawls by exam title, class, and description, to an updated browse setup and recent uploads bar with direct links to the newest exams, something bad turned out pretty good. Also, the request feature has been added, with which users can request specific exams not on the site, and others can search and fill these requests. Lastly, sign-ups have been reduced to only requiring an email/password, which makes the process faster and less invasive. Today I begin the daunting task of uploading all the exams I have(couple hundred), either from Uconn or elsewhere, but this can only serve as a starting foundation. The site needs your contributions! All in all, Fresh Exams is ready for the masses! Enjoy and spread the word! No more need to fear, FreshExams is here!


be made into a drop down news announcement, with say only the title and a + to click on to drop down? and once read click again to bring it back up? Ive seen it on sites, and this would save alot of space on the main page. Thanks for any help, its always very much appreciated!!

bry

This post has been edited by King8654: 17 June 2008 - 08:20 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Help with drop down main page news?[Solved]

#2 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 796
  • Joined: 25-February 08

Re: Help with drop down main page news?[Solved]

Posted 16 June 2008 - 07:29 PM

That seems like too important of a news update to hide under a drop down menu. It should be featured prominently on your page. You could have a very shaken user base who might've lost confidence in the site. Show them that message to let them know that you're on it!

That said, I guess you learned the #1 rule of database management. BACKUP!
Was This Post Helpful? 0
  • +
  • -

#3 quim  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 18
  • View blog
  • Posts: 182
  • Joined: 11-December 05

Re: Help with drop down main page news?[Solved]

Posted 16 June 2008 - 07:40 PM

I think this should be in the Javascript forum
these code will do the job: Javascript - code
function toogle( theId )
{
   var theObj = document.getElementById( theId );
   
    if( theObj.style.display != 'none' )
    {
        theObj.style.display = 'none';
    }
    else 
    {
        theObj.style.display = '';
    }
}


XHTML- code
<a href='#' onclick='toogle("news_0001")'> Here is the title click me! </a>
<div id='news_0001'> Here is the news. There are no news</div>


Was This Post Helpful? 1
  • +
  • -

#4 King8654  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 120
  • Joined: 04-March 08

Re: Help with drop down main page news?[Solved]

Posted 16 June 2008 - 07:50 PM

lol, yes lesson learned HARD!! buddy throught he could clear a couple tables in phpmyadmin, i told him no, he tried, and BAM, main site db gone lol...yah i was pissed..BUT backed up as soon as site got back on feet

i want the message to show up initially when the user comes to the site, but want them to have an option(the +) to minimize it if need be. Yes its important lol

EDIT: News script worked GREAT, thanks m8!!!

also, while the db going byebye sucked, the user base on the site needed to wiped out, honestly. Most were students who made retarded names and just to see what it was, and havent visited again in months. Needed a new start for the site once it was finally finished, kinda a re-opening lol.

and i got the idea of requesting exams after the db got wiped, and cleaned up alot with the site that was wrong, so worked out alright in the end.

EDIT #2: The script is AWESOME, but how do I get it to stay up after its clicked once when going in btw different pages on the site. Is that even possible since all the sites basically funnel through the index.php?

This post has been edited by King8654: 16 June 2008 - 08:02 PM

Was This Post Helpful? 0
  • +
  • -

#5 King8654  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 120
  • Joined: 04-March 08

Re: Help with drop down main page news?[Solved]

Posted 16 June 2008 - 11:39 PM

or better yet, how do i have it only show the title when a user visits the page, and if they want to see they can click it, and then click it again to reset it back to its initial state of being hidden
Was This Post Helpful? 0
  • +
  • -

#6 King8654  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 120
  • Joined: 04-March 08

Re: Help with drop down main page news?[Solved]

Posted 17 June 2008 - 07:00 AM

Nevermind guys/gals, i actually got it lol, my first take at trying to customize javascript. :^:

<script type="text/javascript">
function toogle( theId )
{
   var theObj = document.getElementById( theId );
	 
if (theObj) { 
	theObj.className=(theObj.className=='hidden')?'unhidden':'hidden';
	}
}
</script>



<a href='#' onclick='toogle("news_0001")'><strong> EXTREMELY IMPORTANT MESSAGE TO ALL FRESHEXAMS USERS!!</strong> </a>
<div id='news_0001' class='hidden'>
DESIRED INPUT - my news way to wasteful of space to recopy in lol
</div>



and lastly added this to the stylesheet

.hidden { display: none; }
.unhidden { display: block; }


This post has been edited by King8654: 17 June 2008 - 07:02 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1