Jump to content

chordsoflife

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chordsoflife's Achievements

Member

Member (2/5)

0

Reputation

  1. Not as simple as I thought I guess. Here's a link to the exact issue I'd like to solve: http://plugins.jquery.com/node/7111 There's a solution down at the bottom but I can't wrap my head around it.. still "Learning jQuery" (really, I have the book!). Can anyone dumb that down or tell me if it'll work at least?
  2. Sorry, here it is: <div id="nav" style="position: relative; z-index: 8;"> <ul> <li><a href="/index.php">Homepage</a></li> <li><a href="/housing.php" id="navHousing">Housing</a></li> <li><a href="/about.php" id="navAbout">About Us</a></li> <li><a href="/future.php" id="navFuture">Future Directions</a></li> <li><a href="/contact.php">Contact Us</a></li> </ul> </div> <div class="subNav"> <ul id="future"> <li style="padding: 0 26px;"><a href="/future-new_housing.php">New Housing</a></li> <li style="padding: 0 26px;"><a href="/future-sash.php" title="Aging Safely at Home">Aging Safely at Home</a></li> <li style="padding: 0 26px;"><a href="/future-vac.php" title="Collaborative">Collaborative</a></li> <li style="padding: 0 26px;"><a href="/future-blog.php">Our Blog</a></li> </ul> <ul id="about"> <li><a href="/about-staff_directory.php">Staff Directory</a></li> <li><a href="/about-board_of_directors.php">Board of Directors</a></li> <li><a href="/about-opportunities.php">Employment and Volunteer Opportunities</a></li> <li><a href="/about-accomplishments.php">Accomplishments</a></li> <li><a href="/about-media_relations.php">Media Relations</a></li> <li style="width: 20px;"><a href="/about-donate.php">Donate</a></li> </ul> <ul id="housing"> <li style="padding: 0 5px;"><a href="/housing-housing_options.php">Housing Options</a></li> <li style="padding: 0 5px;"><a href="/housing-upcoming_openings.php">Upcoming Openings</a></li> <li style="padding: 0 5px;"><a href="/list_properties.php">Properties by Location</a></li> <li style="padding: 0 5px;"><a href="/housing-faq.php">Frequently Asked Questions</a></li> <li style="padding: 0 5px;"><a href="/housing-housing_application.php">Housing Application</a></li> </ul> </div>
  3. $('#future').hide(); $('#about').hide(); $('#housing').hide(); $("#navAbout").hover(function(){ $("#about").fadeIn(1000); }) $("#navFuture").hover(function(){ $("#future").fadeIn(1000); }) $("#navHousing").hover(function(){ $("#housing").fadeIn(1000); }) Only the first hover in the list will work no matter which I hover over first after a page load. Any idea why?
  4. Radio buttons don't automatically output the value of the value attribute. Try it this way: <form method="post" action=""> <label> <script type="text/javascript"> document.write("Potatos"); </script> </label> <input type="radio" id="" value="<script type='text/javascript'>document.write('Potatos');</script>" /> </form> [code]
  5. Hm. I actually figured it out on my own (+1 for life). Here's what I wound up doing in case anyone is interested.. not extremely versatile though. $(document).ready(function(){ function pageload(hash) { $(".page01").hide(); $(".page02").hide(); $(".page03").hide(); if(hash) { $(".page0" + hash + "").fadeIn(); } else { alert("else."); $(".page01").fadeIn(); } } $(".page02").hide(); $(".page03").hide(); $.historyInit(pageload); });
  6. I'm really struggling with this, mostly because I don't know JS very well. If anyone can tell me anything to lead me in the right direction, it would mean the world. Here's the code: function pageload(hash) { alert("function ran"); if(hash) { alert("function true"); $(".page01").hide(); $(".page02").hide(); $(".page03").hide(); //$("." + hash + "").show(); } else { alert("function false"); $(".page01").hide(); $(".page02").hide(); $(".page03").hide(); } } $(document).ready(function(){ $.history.init(pageload); $("a[@rel='history']").click(function(){ var hash = this.href; hash = hash.replace(/^.*#/, ''); alert(hash); }); }); It should be pretty clear what I'm trying to do (and alerts to see if I can figure out what's happening when), but I'll explain: I have three divs on a page, and up top there's a navigation (page 1 2 3). Each link hides two and shows only one page. Each page has about ten links to other pages. When I click to an individual page, I want to be able to click the browsers back button back to whichever "page" (1, 2 or 3) I was on. Thanks!
  7. I've been looking around and although there are many out there, they seem SO slow compared to Google's (which has such a bigger pool to look though). Can anyone point me to a script/tutorial/anything that's quick quick quick?
  8. Agreed, that does work, but I'm more wondering why what I have does NOT work. I've used "$count" successfully after setting it outside of a loop, so the logic is where I'm fuzzy on this one.
  9. Here's the relevant code: $shows = mysql_query("SELECT * FROM tblConcert WHERE fkBandID = '$pk' AND fldConcertDate >= CURDATE() ORDER BY fldConcertDate", $db); $numRows = mysql_num_rows($shows); while($show = mysql_fetch_array($shows, MYSQL_ASSOC)){ $date = date("F j, Y",strtotime($show[fldConcertDate])); if($numRows == 0){ echo "<p>No upcoming shows for $show[fldBand]. <a href='#'>Know of one?</a></p>"; } else { This doesn't work. I assume it's a simple mistake (I'm self taught so I lack a lot of basics), but $numRows is acting like it doesn't exist. If I move that if statement outside of the while loop, it does work, and I guess I can do that, but I'm asking for the learning experience rather than a fix so... why can't I use the variable inside the loop?
  10. Oh well. My logic was that mysql_query returns an array. Arrays fill up starting at 0. So if I echo'd out whatever was in the first "cell" of the array, I'd get what I wanted. Alright, thanks a lot for you help, thorpe.
  11. So something along the lines of: echo $fkPhoneID['fkPhoneID'][0]; won't work? No short way to do it?
  12. $fkPhoneID = mysql_query("SELECT fkPhoneID FROM tblPersonPhone WHERE fkPersonID = $pkPersonID", $conn); That should make more sense. I just typed it up real quick, so I wasn't thinking. My question remains the same though. I know there's only going to be one result, so is there a way to access that without looping through?
  13. $pkPersonID = 56; $fkPersonID = mysql_query("SELECT fkPersonID FROM tblPersonPhone WHERE fkPersonID = $pkPersonID", $conn); echo $fkPersonID['fkPersonID'][0]; This is essentially what I'm looking to do, but I can't seem to get it to work. However, if I loop through it and echo it, then I get the value I'm looking for. Sorry for being vague. Edit: the concept here is what I'm looking for - not necessarily the query. I just want to be able to store the value without dealing with an array.
  14. I'm working with a lot of M:N databases, so I'm having to do a lot of querying for ONLY the foreign key or ONLY the primary key, given the opposite. As such, it's a pain in the neck to loop through when I know it's a single result. Is there a way to echo out the query result without a foreach or while loop?
  15. I'm having the oddest problem. No mater what I use.. fadeIn, show, toggle, etc, the action works WHILE the page is loading, but then disappears when the page is finished loading. Here's the code: <script type="text/javascript"> $(document).ready(function(){ $('.addNumberLink').click(function(){ $('.addNumber').toggle();}); }); </script> Thoughts?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.