Author Archives: Mika

How to Detect iPhone with JavaScript

Use Javascript to detect then apply different style for iPhone. JavaScript   if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {     if (document.cookie.indexOf("iphone_redirect=false") == -1) {         window.location = "http://yoursite.com/iphone";     } }  
Posted in JavaScript | Tagged , , | 1 Comment

Basic Default CSS Print Template

CSS   /* Set default width, margin, float, and    background.  */ body, #wrap, #content, #container, {    width: 100%;    margin: 0;    float: none;    background: #fff url(none); }   /* Remove any elements not needed in print.    This would include navigation, ads, sidebars, etc. */ #nav, .noprint, #footer {    display: [...]
Posted in CSS | Tagged , , , , , | 4 Comments

Simple and Smooth Expand and Collapse with jQuery

HTML example   <h2 class="myClass" id="trigger1">Click here to expand</h2> <div class="hide-container">      <p>Here goes whatever you want to expand/collapse</p>      <p>Here goes whatever you want to expand/collapse</p>      <p>Here goes whatever you want to expand/collapse</p>      <p>Here goes whatever you want to expand/collapse</p> </div>   CSS   .myClass {font-size:20px; color: #FF0000;} [...]
Posted in jQuery | Tagged , , , , | Leave a comment

how to disable the Autoresponder for Web Forms – Business Catalyst/GoodBarry

Just add &SAR=False to the form code: HTML:   <form name="catwebformform47565" method="post" onsubmit="return checkWholeForm47565(this)" enctype="multipart/form-data" action="/FormProcessv2.aspx?WebFormID=12374&amp;OID={module_oid}&amp;OTYPE={module_otype}&amp;EID={module_eid}&amp;CID={module_cid}&amp;SAR=False">  
Posted in Business Catalyst / GoodBarry | Tagged , , , , | Leave a comment

How to Change the Default Text Selection Color with CSS

HTML Example   <p class="selectionBlue">Testing blue selections.</p>   CSS 3   .selectionBlue::selection {         background: #0000FF; /* Safari */         } .selectionBlue::-moz-selection {         background: #0000FF; /* Firefox */ }  
Posted in CSS | Tagged , , , | Leave a comment

Alert Box on iPhone – Xcode

Example:   UIAlertView *someError = [[UIAlertView alloc] initWithTitle: @"Network error" message: @"Error sending your info to the server" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil];   [someError show]; [someError release];  
Posted in iPhone Xcode - Objective C | Tagged , , , | 10 Comments

How to Flipping a View on iPhone SDK

Objective C   - (void) flipView {         [UIView beginAnimations:nil context:NULL];         [UIView setAnimationDuration:kTransitionDuration];                         [UIView setAnimationTransition:([mainView superview] ?                                 UIViewAnimationTransitionFlipFromLeft : UIViewAnimationTransitionFlipFromRight) [...]
Posted in iPhone Xcode - Objective C | Tagged , , , , , | 1 Comment

How to Rename /Duplicate iPhone Project in Xcode 3.x

Rename iPhone Project Step by Step:   1. Copy/rename the folder into new name. 2. Get inside the new folder and rename the .pch and .xcodeproj files. 3. Delete the build folder. 4. Open .xcodeproj file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click [...]
Posted in iPhone Xcode - Objective C | Tagged , , , , | 4 Comments

How to show/hide div with HTML and CSS only – Toggle visibility with CSS

HTML Example:   <a onclick="document.getElementById(‘myDiv’).style.display=’block’;" href="javascript:void(0)">Click Here to show  my div</a></div> <div class="anyclass" id="myDiv"> <p>Here goes the content you want to toggle the visibility</p> <a onclick="document.getElementById(‘myDiv’).style.display=’none’;" href="javascript:void(0)">Close [x]</a> </div>  
Posted in CSS | Tagged , , , , , | 2 Comments

How to set more than one event/option – jQuery Accordion

In The example below we set the mouseover event, auto height option as false and starts with the 3rd selector opened. (The index is a zero-indexed number to match the position of the header)   JavaScript   <script type="text/javascript">         $(function() {                 $(‘.subnav-rhs’).accordion({event: ‘mouseover’, [...]
Posted in jQuery | Leave a comment