Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. opaque the background when the page loading

opaque the background when the page loading

Scheduled Pinned Locked Moved ASP.NET
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chapidi
    wrote on last edited by
    #1

    Hi, I have try to implement the opaque the background when the page loading. (No links or functionality on the main page should be accessible until this page loading is completed). Here am using this code. .......................................................................... ..................................... Default.aspx ..................................... ]]> Untitled Page //---------- function addEvent(obj ,evt, fnc) { if (obj.addEventListener) obj.addEventListener(evt,fnc,false); else if (obj.attachEvent) obj.attachEvent('on'+evt,fnc); else return false; return true; } function removeEvent(obj ,evt, fnc) { if (obj.removeEventListener) obj.removeEventListener(evt,fnc,false); else if (obj.detachEvent) obj.detachEvent('on'+evt,fnc); else return false; return true; } //---------- function appendElement(node,tag,id,htm) { var ne = document.createElement(tag); if(id) ne.id = id; if(htm) ne.innerHTML = htm; node.appendChild(ne); } //---------- function Disablebackground() { // alert('Disable'); greyout(true); } function Enablebackground() { // alert('Enable'); greyout(false); } //---------- function greyout(d) { var obj = document.getElementById('greyout'); if(!obj) { appendElement(document.body,'div','greyout'); obj = document.getElementById('greyout'); obj.style.position = 'absolute'; obj.style.top = '0px'; obj.style.left = '0px'; obj.style.background = '#111'; obj.style.opacity = '.5'; obj.style.filter = 'alpha(opacity=50)'; } //alert(d); if(d) { obj.style.height = document.body.clientHeight+'px'; obj.style.width = document.body.clientWidth+'px'; obj.style.height = Math.max(document.body.scrollHeight,document.body.clientHeight)+'px'; obj.style.width = Mat</x-turndown>

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups