jQuery.fn.redraw = function() { return this.hide(0, function() { $(this).show(); }); }; $(el).redraw(); Tuesday, May 28, 2013
Refreshing Dom Element Using JQuery
Monday, April 29, 2013
CHM help file does not show contents in right-hand pane
Symptom: an externally-originated CHM (Compiled Help) file shows the navigation outline in the left pane, but the right pane displays the error "Navigation to the webpage was canceled".
Cause: Windows security treats ad-hoc CHM files with great suspicion and disables their content under a variety of conditions, including location of the file on a network drive. A search on Google will bring up many pages about this, including Microsoft's own knowledge base. It is unlikely to be a problem with the CHM file itself, but in the way that Windows is handling it. Even Microsoft's own CHM files can be affected.
Workarounds: One or more of the following may solve the issue. The options available will depend on which version of Windows you are using.
- Try copying the file from a network drive location to a local drive (e.g. to C:\Temp\).
- If you get a Security Warning asking if you want to open the file, un-check the option "Always ask before opening this file", if this checkbox is present.
- Navigate to the .chm file in Windows Explorer, right-click on the file, select Properties and click Unblock. Then click OK to save the change.
- If there is no "Unblock" button for the previous step, try going to the file's Properties > Advanced tab and un-check the option "File is ready for archiving". (Unverified, but a low risk change anyway).
- The viewer component may not be correctly registered. From the command prompt, enter regsvr32 hhctrl.ocx and hit return.
- Check that the file name or folder names in the path to the file do not contain the hash character (#). Rename or move the file elsewhere if they do.
To permanently solve item #1, it is possible to edit the registry to allow network drives to be a trusted zone. A web search will bring up more detailed information.
Friday, April 12, 2013
selectionStart property (Internet Explorer)
Friday, January 4, 2013
Resize image proportionally javascript
var container = $(imgContainerId);
var imgRatio = imgObj.height / imgObj.width;
var containerRatio = container.height() / container.width();
var ratio = containerRatio / imgRatio;
imgObj.style.height = ratio * container.height()+ "px";
imgObj.style.width = ratio * container.width()+ "px";
container.append(imgObj);
return container;
};
Usage:
------------
var img= new Image();
img.src="http://localhost/Custom/USSI/Layers/Ticket/Legend.jpeg";
var result=reSizeImageProportionally(img,'.tl_tab_legend_panel_div'); // Div id or Class Name