Tag: HTML

  • How to Customise ShareThis Settings – ShareThis

    Hey everyone, I’ve just added ShareThis to a website I’m currently working on. It’s basically a generator for all your typical social network plugins (Facebook Like, Twitter Share, Google+ etc). The main advantage I’ve found with using it is the detailed analytics. While I haven’t had any major issues, there were a few customisations I…

  • Stop a Link from Going Anywhere – CSS/JavaScript

    Hey everyone, Another quick one – how to stop a link from doing anything. I’ve just come across a need to use a link that acts as a button. A slight UI issue with this is that clicking a hyperlink will with an href value of ‘#’ will push scroll to the top of the…

  • Dropdown Button – Twitter Bootstrap

    Hey everyone, Just a quick post on how to create a dropdown button using Twitter Bootstrap. It’s pretty straight forward, once you’ve included all your CSS etc just add the following code: Button Text Menu Option #1 Menu Option #2 Menu Option #3 Menu Option #4 Menu Option #5 Once you save that you should…

  • FullCalendar Example with Client-Side Event Updates

    Hey everyone, I’ve been mucking around with FullCalendar recently and decided to share one of the prototypes I’ve ended up with. It basically lets the user change the events without having to do a postback. A user simply has to click the event, type in the changes and hit update. I’ve posted the code below,…

  • How to Reset ID of an Element – jQuery

    Hey All, Just a quick post on how to set the ID of an element (in this case a div) with jQuery. I needed to use this to dynamically clone elements. WOOOOOOOOOOOOW $(‘#my_test_id’).attr(‘id’, ‘my_new_id’); The script above sets the id of div to my_new_id. If you’re interested, there’s a whole heap of documentation on the…

  • Modal Popup – Twitter Bootstrap

    Just a quick post on how to create a modal popup using twitter bootstrap: Step #1: Add the following to a page element such as a link or button in order to open the modal: href=”modal_content_name” data-toggle=”modal” i.e. Add Image Step #2: Create a content div i.e. × Modal Header Test Modal Close Save Changes…

  • Allow HTML String – Ruby on Rails

    Just a quick post on how to prevent escaping for HTML within a string. Simply use html_safe?. i.e. The following will show the bold tags as text: <%= "GOOOOOOOGLE”> <b>GOOOOOOOGLE</b> Whereas once we add html_safe the text will be displayed in bold: <%= ("GOOOOOOOGLE”).html_safe?> GOOOOOOOGLE

  • PaperClip Issues – Ruby on Rails

    I finally decided to replace all my existing code to handle images with Paperclip. I was following the screencast by Emerson Lackey, #134 Paperclip, however I ran into a couple of issues. Thankfully they were all very easily fixed, and probably wouldn’t have occurred at all if I’d simply watched the whole screencast instead of…

  • Copying Text from Notepad++ to Microsoft Word

    In the middle of doing up some documentation I realised that the formatting and colors aren’t kept when you copy and paste from Notepad++ to Microsoft Word. Luckily Google was able to help out by showing me default plugin that lets you keep all the syntax highlighting etc. 1: Hightlight any of the text you…

  • Placing Multiple Button_To on the Same Line – Ruby on Rails

    This is a problem that had me confused for an embarrassingly long time. Rails wraps button_to elements within a form and a div. Unfortunately this will take up 100% of the available width. Thankfully the solution is pretty straight forward – simply wrap buttons in a div and float them left like so: ‘button’%> ‘button’…

Create a website or blog at WordPress.com