Jump to content


  • Posts

  • Joined

  • Last visited

afish674's Achievements


Member (2/7)



  1. Hi Ingolme, Tried this and it doesn't seem to make much difference. I think its something to do with the Bootstrap framework CSS but I need to overwrite it. link: http://www.pontus-web.co.uk I added the class "nocrush" and gave it a min-width of 100%, I also tried min-width 1170px (the size of the largest outer container). I just want it to scroll rather than the menu and gradient bar under the header breaking when the window shrinks, and to stop the sidebar popping under the main content div.
  2. I've been using a Wordpress barebones template to create my own. However it has some CSS that is breaking my layout on resizing the window (and on small screens like phones). I'd rather have it so that it adds scrollbars when the content won't fit in the window, so it at least works until I can configure it properly. When you resize the window the sidebar div goes below the main content div. The main content div then gets cut off because of its fixed width and the overflow property. I'm not sure where this is defined in the CSS or how to override it. Any suggestions? Link: http://pontus-web.co.uk/ Thanks!
  3. Try: body{padding:0px;margin:0px;}
  4. The HTML code includes: <section class="homebackground"> <img src="img/image1.jpg" /> <img src="img/image2.jpg" /> <img src="img/image3.jpg" /> <img src="img/image4.jpg" /> </section> This does apply .homepage to the container rather than the images.
  5. Cheers dsonesuk, that worked perfectly!
  6. In the Wordpress template i'm developing a class is returned dependent on the existance of a sidebar like so: <div id="main" class="<?php echo roots_main_class();?> round-corners wborder" role="main"> <?php include roots_template_path(); ?> </div> However, although this class is picked up in Firebug on the left, on the right panel it is not detected, meaning any rules applied to it are not working. Any idea why is this happening? Picture of problem in firebug (the class I want to style to 100% width is called "no-side") Thanks!
  7. You could also try using the jQuery UI for styling buttons. You can make them look pretty swish! http://jqueryui.com/button/
  8. afish674

    Web Speed Help

    Have you optimised all of your images for web? If you're using photoshop open up your images then file > save for web and devices and change the quality down. Make sure they're jpegs or gifs and use the lowest quality you can get away with without making it pixelated. Save, then upload them again.
  9. I'm reading a magazine article about creating a dynamically resizing background image slideshow. This uses CSS initially: .homebackground{z-index:-200;overflow:hidden;min-height:1080px;min-width:1920px;width:100%;height:auto;}.homebackground img{position:absolute;width:100%;height:auto;} and then in case the browser and image aspect ratios are different, it uses some jQuery: function bgresize(){var viewportwidth = $(window).width();var viewportheight = $(window).height();var imagewidth = $('.home').find('.homebackground img').first().width();var imageheight = $('.home').find('.homebackground img').first().height();var imageratio = imagewidth/imageheightif (viewportheight > imageheight) {$('.home').find('.homebackground img').css('width',viewportheight*imageratio).css('height', 'auto');}if (viewportwidth > imagewidth ) {$('.home').find('.homebackground img').css('width', viewportwidth).css('height', 'auto');}if (viewportheight < imageheight) {$('.home').find('.homebackground img').css('height', viewportwidth/imageratio).css('width', 'auto');}if (viewportwidth < imagewidth ) {$('.home').find('.homebackground img').css('height', viewportheight).css('width', 'auto');}}$(window).load(function(){$(window).resize(function(){ bgresize();}); bgresize();}); My demo page using this can be found here: https://dl.dropbox.com/u/13032629/HTML-Flash-Lesson/index.html It doesn't work properly however. The page does rescale, but it has scroll bars on a smaller screen, and even on my large monitor at the native resolution (1920x1080) it scrolls. The magazine indicates that the overflow:hidden; property should stop the scroll bars on a smaller screen. This doesn't happen. Infact taking this rule out makes no difference at all. I'm also unsure as to whether the javascript is doing anything. I put some console.log(); commands in to check the variables were collecting data (they were) but it doesn't seem to make any difference to the image. I don't know if this is to do with my function call being in the main.js file rather than in the HTML file, or if this makes any difference at all? Help much appreciated. Thank you!
  10. //DATABASE CONNECTIONtry{ $pdo = new PDO("mysql:dbname=birthdays; host=localhost","root","Rockon!");}catch (PDOException $e){ die ("ERROR: Could not connect: " . $e->getMessage());}$getBdayInfo = "SELECT first_name, second_name, day, month, note FROM birthdays WHERE month = '$monthName' AND username = '$_SESSION[user]'";$result = $pdo->query($getBdayInfo);$row = $result->fetchAll();if ($row > 1){foreach($row as $r){ echo "'$r'"; }}//END QUERY AND CONNECTIONunset($pdo); I think this code should return a list of First Name Second Name Day Month Note For the logged in user in the current month, I inserted this above the code block I posted above. I don't get any parse errors when opening this page but I don't get a list either. Also this list wouldn't publish the information in the right calender box. I'd need to test the day against the current day and then insert the data in the right box using that somehow. I'm just not exactly sure how.
  11. Sorry, the code is: <?phpfunction build_calendar($month,$year) {$today_date = date("d");$today_date = ltrim($today_date, '0'); // Create array containing abbreviations of days of week. $daysOfWeek = array('S','M','T','W','T','F','S'); // What is the first day of the month in question? $firstDayOfMonth = mktime(0,0,0,$month,1,$year); // How many days does this month contain? $numberDays = date('t',$firstDayOfMonth); // Retrieve some information about the first day of the // month in question. $dateComponents = getdate($firstDayOfMonth); // What is the name of the month in question? $monthName = $dateComponents['month']; // What is the index value (0-6) of the first day of the // month in question. $dayOfWeek = $dateComponents['wday']; // Create the table tag opener and day headers $calendar = "<table class='calendar'>"; $calendar .= "<caption>$monthName $year</caption>"; $calendar .= "<tr>"; // Create the calendar headers foreach($daysOfWeek as $day) { $calendar .= "<th class='header'>$day</th>"; } // Create the rest of the calendar // Initiate the day counter, starting with the 1st. $currentDay = 1; $calendar .= "</tr><tr>"; // The variable $dayOfWeek is used to // ensure that the calendar // display consists of exactly 7 columns. if ($dayOfWeek > 0) { $calendar .= "<td colspan='$dayOfWeek'> </td>"; } $month = str_pad($month, 2, "0", STR_PAD_LEFT); while ($currentDay <= $numberDays) { // Seventh column (Saturday) reached. Start a new row. if ($dayOfWeek == 7) { $dayOfWeek = 0; $calendar .= "</tr><tr>"; } $currentDayRel = str_pad($currentDay, 2, "0", STR_PAD_LEFT); $date = "$year-$month-$currentDayRel"; if($currentDayRel == $today_date ){ $calendar .= "<td class='day' id='today_date' rel='$date'><b>$currentDay</b></td>"; } else { $calendar .= "<td class='day' rel='$date'>$currentDay</td>"; } // Increment counters $currentDay++; $dayOfWeek++; } // Complete the row of the last week in month, if necessary if ($dayOfWeek != 7) { $remainingDays = 7 - $dayOfWeek; $calendar .= "<td colspan='$remainingDays'> </td>"; } $calendar .= "</tr>"; $calendar .= "</table>"; return $calendar;}?> Would I need to enter code somewhere around here? $currentDayRel = str_pad($currentDay, 2, "0", STR_PAD_LEFT); $date = "$year-$month-$currentDayRel"; if($currentDayRel == $today_date ){ $calendar .= "<td class='day' id='today_date' rel='$date'><b>$currentDay</b></td>"; } else { $calendar .= "<td class='day' rel='$date'>$currentDay</td>"; } I'm struggling a bit to follow some of the code as I'm quite new to PHP.
  12. I found out the problem with this eventually. The form re-directs to a different page for processing (form action="submitted.php") before it got to the code defining the exception. Therefore it was bypassing it. After I changed the form to process using the same page the exceptions worked fine! Thanks for your help in troubleshooting.
  13. I'm using a calender from CSS tricks: http://css-tricks.com/snippets/php/build-a-calendar-table/#comment-73575 What I want to do is use this as a base and then do some database queries to input data into the relevent cells about events. The data I have in my database includes day and month. I'm just not sure what code should be added and where in order to get the database entries to appear in the right place! Thanks for any help you can give!
  14. I tried this and it said that it couldn't do it because my headers were already set?
  • Create New...