• Web Development Questions That Don't Need Their Own Thread v2
    3,079 replies, posted
[QUOTE=jaybuz;33732874]You check the offset from the div/image to the top of viewport - then when the page is scrolled you check the scroll height compared to the original div/image offset, when it becomes zero, you add: [code]position: fixed; top: 0;[/code][/QUOTE] and if you want to make it centered/ stretch left and right [code]right:0; left:0;[/code]
I'm trying to make loops for my bracket it alters from [code]players -> vertical lines -> players -> vertical lines -> so on...[/code] ie. [url]http://jung3o.com/!-!/bracket_mkr/mock.html[/url] Single replacement [url]http://jung3o.com/!-!/bracket_mkr/mock/single.html[/url] Double replacement [url]http://jung3o.com/!-!/bracket_mkr/mock/double.html[/url] How would I loop this? I also need to divide and such which makes it harder. ----------------------- Oh, and I'm making this with PHP
Alright, I've got a question for the web designers out there that aren't necessarily freelancers (thought it might apply to you guys as well) What certifications (if any) should graphic/web designers have under their belt in the professional business world? My boss wants to start getting our employees into continuing education, which is great, but I haven't a clue where to start. I know Adobe offers certification courses for individual programs such as Photoshop. As for Dreamweaver, I don't know if it's worth getting certification in that or not since all I really use it for are the occasional design view tasks. The only other one I even thought of was W3Schools, but in their HTML practice test they still think that <b> and <i> are the correct tags to use for bold and italicized text, which makes me wonder... I'm hoping someone here might have some thoughts. In my opinion, being a good graphic/web designer is fairly subjective. Sure, you can certify that you know the syntax and proper coding techniques, but if your stuff still comes out looking awful then your certifications don't really matter much... Thanks in advance!
[QUOTE=TheBigS;33736849]Alright, I've got a question for the web designers out there that aren't necessarily freelancers (thought it might apply to you guys as well) What certifications (if any) should graphic/web designers have under their belt in the professional business world? My boss wants to start getting our employees into continuing education, which is great, but I haven't a clue where to start. I know Adobe offers certification courses for individual programs such as Photoshop. As for Dreamweaver, I don't know if it's worth getting certification in that or not since all I really use it for are the occasional design view tasks. The only other one I even thought of was W3Schools, but in their HTML practice test they still think that <b> and <i> are the correct tags to use for bold and italicized text, which makes me wonder... I'm hoping someone here might have some thoughts. In my opinion, being a good graphic/web designer is fairly subjective. Sure, you can certify that you know the syntax and proper coding techniques, but if your stuff still comes out looking awful then your certifications don't really matter much... Thanks in advance![/QUOTE] All I can definitely say without getting my ass chewed is that W3Schools is a big no-go, and that you shouldn't use Dreamweaver as web devs hate it.
[QUOTE=mobrockers2;33737121]All I can definitely say without getting my ass chewed is that W3Schools is a big no-go, and that you shouldn't use Dreamweaver as web devs hate it.[/QUOTE] Dreamweaver's code view is alright. Just don't use the design view.
[QUOTE=Dragory;33737187]Dreamweaver's code view is alright. Just don't use the design view.[/QUOTE] Most people use it because of the design view, so it is best to stay away from it alltogether.
Don't worry bros, I don't use Dreamweaver or W3Schools religiously. I use Dreamweaver sometimes for being able to quickly select parts of the site in design view and then immediately going back into codeview to mess with it :P I know web devs hate it, but this is more about playing to what employers want to see..since Dreamweaver still is a big name in the software world, I don't know...maybe it would be worth it to get certified saying that I know how to use it. Thanks for the confirmation on W3Schools though!!
[CODE] #Files $englishElementary = 'Elementary-English.pdf'; $englishHighSchool = 'High-School-English.pdf'; $espanolElementary = 'Elementary-Espanol.pdf'; $espanolHighSchool = 'High-School-Espanol.pdf'; #Based on what user selects from select boxes, attach the appropriate file(s) switch ($school) { case 'elementry school': switch($language){ case 'english language': $mail->AddAttachment($englishElementary); break; case 'spanish language': $mail->AddAttachment($espanolElementary); break; case 'both languages': $mail->AddAttachment($englishElementary); $mail->AddAttachment($espanolElementary); } break; case 'high school': switch($language){ case 'english language': $mail->AddAttachment($englishHighSchool); break; case 'spanish language': $mail->AddAttachment($espanolHighSchool); break; case 'both languages': $mail->AddAttachment($englishHighSchool); $mail->AddAttachment($espanolHighSchool); } break; case 'both schools': switch($language){ case 'english language': $mail->AddAttachment($englishHighSchool); $mail->AddAttachment($englishElementary); break; case 'spanish language': $mail->AddAttachment($espanolHighSchool); $mail->AddAttachment($espanolElementary); break; case 'both languages': $mail->AddAttachment($englishHighSchool); $mail->AddAttachment($englishElementary); $mail->AddAttachment($espanolHighSchool); $mail->AddAttachment($espanolElementary); } [/CODE] Just a quick question, is there a cleaner/quicker way to do the above? It looks pretty clean to me but I don't know. It was a rushed project so just done what I knew would work.
[QUOTE=mobrockers2;33737202]Most people use it because of the design view, so it is best to stay away from it alltogether.[/QUOTE] As someone who is forced to use Dreamweaver for school, I noticed how horrible design view was very early on. It's about as functional as IE6. It's even worse because we have to develop for IE8, and that's[I] miles[/I] better than design view. I do enjoy code view though, its suggestions are pretty useful for somebody who still doesn't know everything about CSS. Are there other web-programming centric programs that have something like that?
I'm using fancybox and carrierwave on rails3, attempting to have fancybox display a pdf in a iframe, right now it currently just downloads the pdf to the users computer unless they have a pdf webviewer, I'd like to have it viewable in the browser inside the modal/fancybox. current view is: [CODE] <% for issue in @issues %> <tr> <td><%= issue.date %></td> <td><%= link_to "view pdf", issue.pdf_url, :class => "fancybox" %> <td><%= link_to "Show", issue %></td> <td><%= link_to "Edit", edit_issue_path(issue) %></td> <td><%= link_to "Destroy", issue, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %>[/CODE] I figure there is a way i could use the google doc viewer found [URL="https://docs.google.com/viewer"]here[/URL] but i'm not entirely sure how i would create the link or how would i test locally since the viewer would obviously not be able see the pdf if i'm running from a localhost. What solutions are available for rails? I'd like to host the pdfs locally. Also is there a way to use rmagick to generate a png or jpg of the 1st page to use as a preview? **Update:** I went ahead and tried using this as my link however it pulls an error. <%= link_to "view pdf", 'http://docs.google.com/gview?url=#<%= issue.pdf_url %>', :class => "fancybox" %> error is [CODE] /app/views/issues/index.html.erb:10: syntax error, unexpected $undefined, expecting ')' ...);@output_buffer.safe_concat('\', :class => "fancybox" %> ... [/CODE] ^
You're trying to nest ERB? [code]<%= link_to "view pdf", 'http://docs.google.com/gview?url=#{issue.pdf_url}', :class => "fancybox" %>[/code] You could try `convert foo.pdf[0] foo.png` to render the first page to a image, but I haven't tested this myself.
Correct, and that got me in the right direction, Still trying to learn where and when curly brackets are used, still quite new to rails. how ever that only links to http://docs.google.com/gview?url=#{issue.pdf_url}, it doesn't actually embed the path for the pdf in the link. I also just realized i need to add [url]http://example.com/[/url] before the erb. And i'll try the convert, i figured it was something i would have carrier wave/rmagick take care of so it stored it in the database and only had to create it once, but i'll fool around with it.
[code]<%= link_to "view pdf", "http://docs.google.com/gview?url=#{issue.pdf_url}", :class => "fancybox" %>[/code] Should work. Forgot to change the quotes (from 'single' to "double").
I'm 99% sure, the end user has to be logged into a Google account before they can see the PDF.. I don't know if that's something which you might want to take into consideration
[QUOTE=itsbth;33749190][code]<%= link_to "view pdf", "http://docs.google.com/gview?url=#{issue.pdf_url}", :class => "fancybox" %>[/code] Should work. Forgot to change the quotes (from 'single' to "double").[/QUOTE] Double quotes don't make a difference, i had thought that might be the issue, and tried double quotes but no luck. [QUOTE=kingzl3y;33750862]I'm 99% sure, the end user has to be logged into a Google account before they can see the PDF.. I don't know if that's something which you might want to take into consideration[/QUOTE] You actually don't have to be logged into a google account, I've already tested it and it works just fine without being logged in. In all honesty for users that have adobe reader installed it'll show up just fine without using google docs, but for users who are on ubuntu who may not have the standard acroreader installed, it'll try to download it, so that's the only real reason i'm doing it this way, i'm thinking of looking into scribd's api for their flash pdf viewer but it seems more complicated then i'd like to get.
[QUOTE=Luc1f3r;33757737]Double quotes don't make a difference, i had thought that might be the issue, and tried double quotes but no luck.[/QUOTE] You can't use #{string.interpolation} in single quotes
what's the easiest way to disable the gay default link styles in css? I mean, is there a more elegant solution than manually setting styles for a:link ?
just use: [code]a{color:black;text-decoration:none;}[/code] You only need to add that at the top of your css document and you won't need to set the style for each new link.
[QUOTE=kragmars102;33763370]just use: [code]a{color:black;text-decoration:none;}[/code] You only need to add that at the top of your css document and you won't need to set the style for each new link.[/QUOTE] -snip- Bad reading.
I wonder anyone here can find a problem with my search feature that I need to get done for a project I'm working for work. Since I can't myself figure out what's wrong and what needs to be done. Image of search page. [img]http://dl.dropbox.com/u/15894462/ZScreen/2011-12/search_1.png[/img] Search function. [php] function searchResidence( $Search ) { if( !empty( $Search ) ) { try { $searchResidence = $this->dbh->prepare( "SELECT * FROM `residence` WHERE `Area` = ? AND `Type` = ? AND `Available` = ? AND `Terrace` = ? AND `Balcony` = ? AND `Sauna` = ? AND `Electricity` = ? AND `CommonKitchen` = ? AND `Gymnastics` = ? AND `Guestroom` = ? AND `HouseholdUtensils`= ? AND `Internet` = ? AND `Cable-TV` = ? AND `Furnished` = ? AND `Parkinglot`= ? AND `Meetingplace` = ? AND `1MonthEnd` = ? AND `3MonthEnd` = ? AND `10MonthRent` = ? AND `12MonthRent` = ?" ); $searchResidence->execute( array( $Search[0], $Search[1], $Search[2][0], $Search[2][1], $Search[2][2], $Search[2][3], $Search[2][4], $Search[2][5], $Search[2][6], $Search[2][7], $Search[2][8], $Search[2][9], $Search[2][10], $Search[2][11], $Search[2][12], $Search[2][13], $Search[2][14], $Search[2][15], $Search[2][16], $Search[2][17] ) ) or die ('Error'); $result = $searchResidence->fetchAll( PDO::FETCH_NUM ); if( $result == false ) { header( "refresh:300;url=index.php?tab=residence&action=search" ); echo 'Ingen bostad kunde hittas med din sökning.'; echo '<br />'; echo '<br />'; echo '<br />'; echo '<a href="index.php?tab=residence&action=search"><b>Klicka här om du inte automatiskt kommer till sök sidan.</b></a>.'; return $result; } else { return $result; } } catch( Exception $e ) { echo 'Error: '.$e->getMessage(); $this->dbh->rollBack(); } } } [/php] Search form. [php] <!-- Fieldset --> <fieldset> <!-- Legend --> <legend> Sök Bostad <!-- End Legend --> </legend> <!-- Search Residence Form --> <form action="index.php?tab=residence&action=searchResult" method="POST"> <label for="Area">Område:</label> <br /> <select name="Area" id="Area"> <option value="">Alla</option> <?php foreach( $Residence->residenceArea() as $row ) { echo '<option value="'.$row[0].'">'.$row[1].'</option>'; } ?> </select> <br /> <br /> <label for="Type">Bostadstyp:</label> <br /> <select name="Type" id="Type"> <option value="">Alla</option> <?php foreach( $Residence->residenceType() as $row ) { echo '<option value="'.$row[0].'">'.$row[1].'</option>'; } ?> </select> <br /> <input type="checkbox" name="Properties[0]" id="Available" value="1" /><label for="Available">Endast lediga bostäder</label> <br /> <br /> <input type="checkbox" name="Properties[1]" id="Terrace" value="1" /><label for="Terrace">Altan</label> <br /> <br /> <input type="checkbox" name="Properties[2]" id="Balcony" value="1" /><label for="Balcony">Balkong</label> <br /> <br /> <input type="checkbox" name="Properties[3]" id="Sauna" value="1" /><label for="Sauna">Bastu</label> <br /> <br /> <input type="checkbox" name="Properties[4]" id="Electricity" value="1" /><label for="Electricity">El</label> <br /> <br /> <input type="checkbox" name="Properties[5]" id="CommonKitchen" value="1" /><label for="CommonKitchen">Gemensamt kök</label> <br /> <br /> <input type="checkbox" name="Properties[6]" id="Gymnastics" value="1" /><label for="Gymnastics">Gymnastiksal</label> <br /> <br /> <input type="checkbox" name="Properties[7]" id="Guestrum" value="1" /><label for="Guestrum">Gästrum</label> <br /> <br /> <input type="checkbox" name="Properties[8]" id="HouseholdUtensils" value="1" /><label for="HouseholdUtensils">Husgeråd</label> <br /> <br /> <input type="checkbox" name="Properties[9]" id="Internet" value="1" /><label for="Internet">Internet</label> <br /> <br /> <input type="checkbox" name="Properties[10]" id="Cable-TV" value="1" /><label for="Cable-TV">Kabel-TV</label> <br /> <br /> <input type="checkbox" name="Properties[11]" id="Furnished" value="1" /><label for="Furnished">Möblerat</label> <br /> <br /> <input type="checkbox" name="Properties[12]" id="Parkinglot" value="1" /><label for="Parkinglot">Parkering</label> <br /> <br /> <input type="checkbox" name="Properties[13]" id="Meetingplace" value="1" /><label for="Meetingplace">Samlingslokal</label> <br /> <br /> <input type="checkbox" name="Properties[14]" id="1MonthEnd" value="1"><label for="1MonthEnd">1 mån. uppsägningstid</label> <br /> <br /> <input type="checkbox" name="Properties[15]" id="3MonthEnd" value="1" /><label for="3MonthEnd">3 mån. uppsägningstid</label> <br /> <br /> <input type="checkbox" name="Properties[16]" id="10MonthRent" value="1" /><label for="10MonthRent">10 månadshyror</label> <br /> <br /> <input type="checkbox" name="Properties[17]" id="12MonthRent" value="1" /><label for="12MonthRent">12 månadshyror</label> <br /> <br /> <input type="submit" value="Sök bostad" /> <!-- End Search Residence Form --> </form> <!-- End Fieldset --> </fieldset> [/php] Search result code. [php] $Properties = array(); if( isset( $_POST['Properties'] ) ) { $Properties = $_POST['Properties']; $Search = array( $_POST['Area'], $_POST['Type'], $Properties ); for($i = 0; $i <= 17; $i++) { if( !array_key_exists( $i, $Search[2] ) ) { $Search[2][$i] = '0'; } } } else { $Properties = array(); $Search = array( $_POST['Area'], $_POST['Type'], $Properties ); for($i = 0; $i <= 17; $i++) { if( !array_key_exists( $i, $Search[2] ) ) { $Search[2][$i] = ''; } } } $residenceSearch = $Residence->searchResidence( $Search ); if( !empty( $residenceSearch ) ); { ?> Resultat av din sökning. <br /> <br /> <!-- Search Residence List --> <table class="list"> <thead> <tr> <td></td> <td>Område</td> <td class="type">Bostadstyp</td> <td>Boyta</td> <td>Hyra</td> <td>Antal i kö</td> <td>Lägenhets nummer</td> </tr> </thead> <tfoot> <tr> <td></td> <td>Område</td> <td class="type">Bostadstyp</td> <td>Boyta</td> <td>Hyra</td> <td>Antal i kö</td> <td>Lägenhets nummer</td> </tr> </tfoot> <tbody> <?php foreach( $residenceSearch as $row ) { ?> <tr> <td></td> <td><a href="index.php?tab=residence&action=show&id=<?php echo $row[0]; ?>"><?php echo $Residence->getResidenceArea($row[1]); ?></a></td> <td class="type"><?php echo $Residence->getResidenceType($row[2]); ?></td> <td><?php echo $row[3]; ?></td> <td><?php echo $row[4]; ?></td> <td></td> <td><?php echo $row[5]; ?></td> </tr> <?php } ?> </tbody> <!-- End Search Residence List --> </table> <?php } [/php] So with all this code, I wonder if anyone of you can understand my problem with this. Since it's a somewhat vital part of the work and I have no idea how it will best be done. And I hope the code speaks for itself. [editline]Information[/editline] With the problem being how I can make it search for everything when nothing is checked in properties or chosen in the drop down lists (drop downs should say "Alla"[Everything] ).
Looking at a different VPS host (probably hexxeh) due to my current one being terrible... and I mean terrible, it's the abortion of the VPS Hosts. Anyway would you guys say 256mb would run about a 5 person TS3 Server and LAMP with Wordpress? I've been looking up and found that it might be alright, but it's best to get an opinion from people who definately know what they're talking about rather than the first few results from Google.
I don't have any experience with TS3, but that should be more than enough.
[QUOTE=itsbth;33776528]I don't have any experience with TS3, but that should be more than enough.[/QUOTE] Alright, thanks, anyone got a refferal link for hexxeh's VPS's they want me to use?
I'm probably doing something wrong here, but does anybody know why the on() method in jQuery is not working for me? [url]http://jsfiddle.net/a/J2MQy/[/url] This works: [code] $('.comment').hover(function() { $(this).css({'border-bottom':'1px solid #999'}); }, function() { $(this).css({'border-bottom':'1px solid #ccc'}); }); [/code] But I need to use the on() method as it needs to apply to elements in the future too i.e. those that have been dynamically created. So I tried this code: [code] $('.comment').on('hover', function() { $(this).css({'border-bottom':'1px solid #999'}); }, function() { $(this).css({'border-bottom':'1px solid #ccc'}); }); [/code] But it doesn't seem to work. Anyone know why?
in javascript, how do I check if a string contains certain characters? Like, is there a function that can check whether it contains special characters?
[QUOTE=Alcapwne;33779268]in javascript, how do I check if a string contains certain characters? Like, is there a function that can check whether it contains special characters?[/QUOTE] Use .indexOf('word') 'Hello world and all who inhabit it'.indexOf('and') // returns index of 'and' in string It returns -1 if the string is not found
[QUOTE=aerochug;33779541]Use .indexOf('word') 'Hello world and all who inhabit it'.indexOf('and') // returns index of 'and' in string It returns -1 if the string is not found[/QUOTE] perfect, thanks a lot! how would I add multiple 'words' to test for?
Regex would prevent many if statements but then Regex can be more costly if you're doing it many times. [code] if ( \word|word|word\.test(var) ) { } [/code]
[QUOTE=jaybuz;33779766]Regex would prevent many if statements but then Regex can be more costly if you're doing it many times. [code] if ( \word|word|word\.test(var) ) { } [/code][/QUOTE] thanks for the reply, what do you mean by costly?
[QUOTE=Alcapwne;33779790]thanks for the reply, what do you mean by costly?[/QUOTE] Regex is complex. By costly, I mean time/resources. Normal Javasript functions are usually always faster.
Sorry, you need to Log In to post a reply to this thread.