Knowledge Base: Error Messages builds up on IE runtime

Problem:

Error Messages builds up on IE runtime

ieError

 

Cause:

These are IE runtime (not compilation) errors

 

Solution:

To suppress the default Internet Explorer error message for the window event, set the returnValue property of the event object to true or simply return true in Microsoft JScrip

 

window.onerror = function() {

// Return true to tell IE we handled it

returntrue;

};

 

 

Reference:

http://stackoverflow.com/questions/5301383/ie-prevent-errors-from-being-shown-in-ie

 

Date Posted:26052014

 

Knowledge Base: Centering fluid-width div (auto-width) is not possible using traditional auto margin because a width is not specified

Problem:

Centering fluid-width div (auto-width) is not possible using traditional auto margin because a width is not specified

 

Cause:

Width-less element can’t be centered

 

Solution:

Change the display property of the affected element with display:table

 

From this:

#listFilter-slider-container .orbit-bullets {

margin: 5px auto 25px;

width: auto;

}

 

Change to this:

#listFilter-slider-container .orbit-bullets {

margin: 5px auto 25px;

width: auto;

display:table;

}

 

Reference:

Elimination technique

 

Published: 4 April 2014

Knowledge Base: SHAREPOINT 2010 DOESN’T DETECT SCROLLING

Problem:

SHAREPOINT 2010 DOESN’T DETECT SCROLLING

 

Cause:

The purpose of disabling scrolling is entirely due to the new SharePoint 2010 “ribbon” control. This is a very handy element of the SharePoint interface that stays fixed to the browser window, even as you scroll down the page.

 

Solution:

The Solution

What’s done is done, and now that I’m done griping, let’s get constructive and look at some potential resolutions for this issue. Implementing this fix requires adding both CSS and JavaScript to your master page:

 

  1. Remove scroll=”no” from the <body> tag (this fixes scrolling on older browsers like IE6).
  2. Inside a <script> block or in an attached JavaScript file, add the following script:

function FixRibbonAndWorkspaceDimensions(){

ULSxSy:;

g_frl = true;

var elmRibbon = GetCachedElement(“s4-ribbonrow”);

var elmWorkspace = GetCachedElement(“s4-workspace”);

var elmTitleArea = GetCachedElement(“s4-titlerow”);

var elmBodyTable = GetCachedElement(“s4-bodyContainer”);

if(!elmRibbon || !elmWorkspace || !elmBodyTable){

return;

}

if (!g_setWidthInited){

var setWidth = true;

if (elmWorkspace.className.indexOf(“s4-nosetwidth”) > -1)

setWidth = false;

g_setWidth = setWidth;

g_setWidthInited = true;

}

else{

var setWidth = g_setWidth;

}

var baseRibbonHeight = RibbonIsMinimized() ? 44 : 135;

var ribbonHeight = baseRibbonHeight + g_wpadderHeight;

if(GetCurrentEltStyle(elmRibbon, “visibility”) == “hidden”){

ribbonHeight = 0;

}

 

// Override default resizing behavior

// — adds padding to the top of the “s4-workspace” <div> if the ribbon exists and has content

// — allows the ribbon to be positioned using CSS instead of JavaScript (more accessible)

// — checks to see if the page is inside a “no-ribbon” dialog

if(elmRibbon.children.length > 0 && document.getElementsByTagName(“html”)[0].className.indexOf(‘ms-dialog-nr’) == -1){

elmWorkspace.style.paddingTop = ribbonHeight + ‘px’;

}

}

 

  1. In a <style> block or in an attached CSS style sheet, add the following CSS rules to override the default overflow styles:

body.v4master {

overflow: visible;

height: inherit;

width: inherit;

}

body #s4-workspace {

overflow: visible !important;

}

body #s4-ribbonrow {

position: fixed;

z-index: 1000;

}

#s4-ribbonrow .ms-MenuUIPopupBody, #s4-ribbonrow .ms-popoutMenu, .ms-cui-menu[id ^= “Ribbon.”] {

position: fixed !important;

}

.ms-dlgOverlay {

width: 100% !important;

}

 

Reference:

http://kyleschaeffer.com/sharepoint/sharepoint-2010-scrolling/

 

Date Posted:13022014

Knowledge Base: How to create your own defined function to be reused later as a callback to other functions

Problem:

How to create your own defined function to be reused later as a callback to other functions

 

Cause:

N/A

 

Solution:

Create a function, eg below and give it a unique name eg bottomWrapFunction

 

$.fn.bottomWrapFunction = function() {

$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());

m = $(“#mainWrap”).height();

f = $(“#footerWrap”).height();

h = m – f;

if ($.browser.msie && $.browser.version == 8) {

$(“.sub-bottomWrap”).css(“height”,h + 15);

}

else if ($.browser.chrome) {

$(“.sub-bottomWrap”).css(“height”,h + 15);

}

else

$(“.sub-bottomWrap”).css(“height”,h);

}

 

Usage: recall the function later as a callback in another function:

$(‘.menu-vertical > ul > li > ul > li > a[href$=”‘ + path + ‘”]’).parents().prevAll(‘.solidArrow-right’).hide(function(){

$.fn.bottomWrapFunction();

});

 

Reference:

http://stackoverflow.com/questions/2520172/call-user-defined-function-in-jquery

 

Published: 29 Oct 2013

Knowledge Base: Google Webfonts Locked Down in Intranet

Problem:

Google Webfonts Locked Down in Intranet

 

Cause:

This is deemed insecure in https environment (notice the url http instead of https)

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300|Open+Sans+Condensed:300)

 

Solution:

Remove the http from the url

@import url(//fonts.googleapis.com/css?family=Open+Sans:400,300|Open+Sans+Condensed:300);

 

Reference:

http://stackoverflow.com/questions/16105819/how-to-use-google-webfonts-in-a-locked-down-intranet

http://www.amixa.com/blog/2012/06/06/how-to-use-google-fonts-under-both-ssl-and-non-ssl-without-ssl-insecure-messages/

 

 

Published: 03 Oct 2013

Knowledge Base: List Style Image not showing in IE7

Problem:

List Style Image not showing in IE7

 

CSS:

.formContent > ul li {

list-style-image: url(“../images/btn/redDot.png”);

line-height:120%;

margin:00013px;

}

 

Cause:

If not positioned relatively, CSS proprety “list-style-image” won’t appear on IE7

 

Solution:

CSS:

.ie7.formContent > ul li {

list-style-image: url(“../images/btn/redDot.png”);

line-height:120%;

margin:00010px;

position:relative;

}

 

 

Date Created:070813