Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    Caricamento immagini malfunzionamento su explorer

    Ciao a tutti,
    ho una pagina web che tramite css e javascript richiama una serie di immagini come immagini di background. Ora..funziona benissimo su tutti i browser tranne che su explorer (io l'ho testato sulla versione 9, non so su quelle precedenti).

    Il codice della pagina che fa ciò è il seguente:

    <div class="bgSelector right">
    <nav class="bgNav">
    <ul> Seleziona un immagine:
    <li class="active"><span>1</span>[*]<span>2</span>[*]<span>3</span>[*]<span>4</span>[*]<span>5</span>[*]<span>6</span>[/list]
    </nav>
    </div>

    Come posso fare secondo voi per risolvere questa cosa?

    Grazie anticipatamente per ogni aiuto.

  2. #2
    Utente di HTML.it
    Registrato dal
    Apr 2012
    Messaggi
    159
    Puoi postare la parte di codice CSS relativa a questa parte?

  3. #3

    re

    Ciao freenetw e grazie innanzitutto.

    Il codice css è il seguente:


    .bgSelector {position:absolute; z-index:9; top:414px; right:69px;}
    #bgStretch {overflow:hidden;}
    .bgNav {cursor:default;padding:12px 29px 0 14px;}
    .bgNav li {display:inline-block; height:17px;}
    .bgNav li span {margin-left:5px;}
    .bgNav a {display:block; height:17px; width:17px; padding-top:2px; background: url(../images/bg_selector.png) no-repeat scroll right 0 transparent; font:13px Droid Sans, sans-serif; color:#5e5e5e; text-decoration:none; text-shadow:1px 1px 1px #fff}
    .bgNav a:hover, .bgNav .active a {background-position: left center; color:#fff; text-shadow:1px 1px 1px #6b664c}


    Grazie ancora

  4. #4
    Utente di HTML.it
    Registrato dal
    Apr 2012
    Messaggi
    159
    Qui sembra essere tutto ok, posta la parte JS che si occupa di cambiare lo sfondo.

  5. #5

    re

    Ciao,

    ti copio/incollo tutto il codice del file denominato bgStretch che è quello che dovrebbe gestire le immagini del backgrounfd della mia pagina web.
    Fammi sapere.

    Grazie 1000


    //0.3.0
    (function($){
    $.fn.bgStretch=function(o){
    this.each(function(){
    var th=$(this),
    data=th.data('bgStretch'),
    _={
    align:'leftTop',
    css:{
    leftTop:{
    left:0,
    right:'auto',
    top:0,
    bottom:'auto'
    },
    rightTop:{
    left:'auto',
    right:0,
    top:0,
    bottom:'auto'
    },
    leftBottom:{
    left:0,
    right:'auto',
    top:'auto',
    bottom:0
    },
    rightBottom:{
    left:'auto',
    right:0,
    top:'auto',
    bottom:0
    }
    },
    preFu:function(){
    _.img
    .load(function(){
    _.k=_.img.height()/_.img.width()
    _.img
    .css({
    width:'100%',
    height:'100%',
    position:'absolute',
    zIndex:-1,
    left:0,
    top:0
    })
    })
    _.img[0].complete
    &&_.img.trigger('load')
    _.me
    .css({
    position:'absolute',
    zIndex:-1
    })
    .css(_.css[_.aalign=_.align])
    _.wrap
    .css({
    width:'100%',
    height:'100%',
    position:'fixed',
    left:0,
    top:0,
    overflow:'hidden',
    zIndex:-1
    })
    },
    resizeFu:function(){
    var wh=_.win.height(),
    ww=_.win.width(),
    k=wh/ww
    if(_.aalign!=_.align)
    _.me
    .css(_.css[_.aalign=_.align])

    if(k<_.k)
    _.me
    .css({
    width:ww,
    height:ww*_.k
    })
    else
    _.me
    .css({
    width:wh/_.k,
    height:wh
    })

    },
    chngFu:function(str){
    $.fn.sImg
    ?_.me.sImg(str)
    :_.img.attr({src:str})
    },
    init:function(){
    _.win=$(window)
    _.img=$('img',_.me)
    _.me.wrap('<div></div>')
    _.wrap=_.me.parent()

    _.preFu()
    $(window)
    .resize(function(){
    _.resizeFu()
    })
    .trigger('resize')
    _.navigs&&_.navigs.data('navigs')
    &&_.navigs.navigs(function(n,__){
    _.chngFu(__.href)
    })

    }
    }
    data?_=data:th.data({bgStretch:_})
    typeof o=='object'&&$.extend(_,o)
    _.me||_.init(_.me=th)

    typeof o=='string'&&_.chngFu(o)
    })
    return this
    }
    })(jQuery)

    //0.2.3 image changer
    ;(function($){
    $.fn.sImg=function(o,cb){
    this.each(function(){
    var th=$(this),
    data=th.data('sImg'),
    _={
    duration:1000,
    sleep:300,
    spinner:false,
    preFu:function(){
    _.me.css('position')=='static'
    &&_.me.css({position:'relative',zIndex:1})
    },
    chngFu:function(src){
    if(src==_.src)
    return false
    _.src=src
    _.buff=_.buff||$('<img>').css({position:'absolute' ,top:'-999%',left:'-999%'})
    if(_.clone&&_.clone.is(':animated'))
    _.clone.stop()
    if(_.clone)
    _.clone.remove()
    if(_.spinner!==false)
    if(typeof _.spinner=='string')
    _.spinner=$(_.spinner).hide()
    else
    if(typeof _.spinner=='object')
    _.spinner
    //.appendTo(_.me)
    .fadeIn()
    _.buff
    .appendTo('body')
    .unbind('load')
    .load(function(){
    setTimeout(function(){
    if(_.img.css('position')=='static')
    _.me
    .css({
    width:_.buff.width(),
    height:_.buff.height()
    }),
    _.img
    .css({
    position:'absolute',
    left:0,
    top:0
    })
    _.clone=_.img.clone()
    .css({
    position:'absolute',
    left:_.img.prop('offsetLeft'),
    top:_.img.prop('offsetTop')
    })
    .appendTo(_.me)
    _.spinner
    &&_.spinner.fadeOut()
    _.img.attr({src:src})
    _.clone
    .stop()
    .animate({
    opacity:0
    },{
    duration:_.duration,
    complete:function(){
    _.clone.remove()
    cb&&cb()
    }
    })
    _.buff.detach()
    _.spinner
    &&_.spinner.hide()
    },_.sleep)
    })
    .attr({src:src})
    },
    init:function(){
    _.img=$('>img',_.me)
    _.preFu()
    }
    }
    data?_=data:th.data({sImg:_})
    typeof o=='object'&&$.extend(_,o)
    _.me||_.init(_.me=th)

    if(_.spinner!==false)
    if(typeof _.spinner=='string')
    _.spinner=$(_.spinner).hide()

    typeof o=='string'&&_.chngFu(o)
    })
    return this
    }
    })(jQuery)

    //0.4.3
    ;(function($){
    $.fn.navigs=function(o){
    this.each(function(){
    var th=$(this),
    data=th.data('navigs'),
    _={
    enable:true,
    actCl:'active',
    changeEv:'change',
    indx:[],
    hshx:[],
    useHash:false,
    defHash:'#!/',
    outerHash:false,
    autoPlay:false,
    blockSame:true,
    hover:true,
    contRetFalse:true,
    preFu:function(){
    _.li.each(function(n){
    var th=$(this)
    _.indx[n]=th
    _.useHash
    &&(_.hshx[n]=$('a',th).attr('href'))
    &&location.hash==_.hshx[n]
    &&th.addClass(_.actCl)
    })
    },
    rfrshFu:function(){
    _.prev=_.curr
    _.pren=_.n
    _.curr=false
    _.n=-1
    _.param='close'

    _.li.each(function(n){
    var th=$(this)
    if(th.hasClass(_.actCl))
    _.curr=th,
    _.n=n,
    _.href=$('a',th).attr('href'),
    _.param=_.useHash?_.href:_.n
    })
    },
    markFu:function(){
    _.li.each(function(n){
    var th=$(this)
    _.n==n?_.hvrin(th):_.hvrout(th)
    })
    },
    hashFu:function(){
    $(window)
    .bind('hashchange',function(){
    _.prevHash=_.hash
    _.checkHashFu(_.outerHash=_.hash=location.hash)
    })
    $('a',_.li)
    .click(function(){
    if(!_.enable)
    return false
    })
    },
    checkHashFu:function(hash){
    if(hash=='#back')
    return _.backFu()
    if(hash=='#close')
    return _.closeFu()
    _.li.each(function(n){
    if(_.hshx[n]==_.hash)
    _.chngFu(n),
    _.outerHash=false
    })
    if(_.outerHash)
    _.li.removeClass(_.actCl),
    _.rfrshFu(),
    _.markFu(),
    _.param=_.outerHash,
    _.me.trigger(_.changeEv)
    },
    cntrFu:function(){
    _.li.each(function(n){
    var th=$(this)
    $('a',th)
    .click(function(){
    _.chngFu(n)
    if(_.contRetFalse)
    return false
    })
    })
    },
    autoPlayFu:function(){
    if(!_.autoPlay)
    return false
    if(_.int)
    clearInterval(_.int)
    _.int=setInterval(_.nextFu,_.autoPlay)
    },
    chngFu:function(n){
    if(!_.enable)
    return false
    if(n==_.n&&_.blockSame)
    return false
    _.indx[n]
    &&_.li.removeClass(_.actCl)
    &&_.indx[n].addClass(_.actCl)
    _.rfrshFu()
    _.markFu()
    _.autoPlayFu()
    if(_.useHash&&location.hash!=_.hshx[_.n])
    location.hash=_.hshx[_.n]

    _.me.trigger(_.changeEv)
    },
    closeFu:function(){
    _.li.removeClass(_.actCl)
    _.rfrshFu()
    _.markFu()
    _.me.trigger(_.changeEv)
    location.hash=_.defHash
    },
    backFu:function(){
    _.chngFu(_.pren)
    },
    nextFu:function(){
    var n=_.n
    _.chngFu(++n<_.li.length?n:0)
    },
    prevFu:function(){
    var n=_.n
    _.chngFu(--n>=0?n:_.li.length-1)
    },
    customStr:function(str){
    //console.log(str)
    },
    init:function(){
    //_.me.bind(_.changeEv,function(){_.defFunc(_.param, _)})
    _.li=$('>ul>li',_.me)
    _.preFu()
    _.rfrshFu()
    _.markFu()
    _.useHash
    ?_.hashFu()
    :_.cntrFu()
    _.hoverFu()
    _.autoPlayFu()
    _.useHash
    &&_.checkHashFu(_.outerHash=_.hash=location.has h)
    //_.defFunc(_.param,_)
    _.li.hasClass(_.actCl)
    &&_.me.trigger(_.changeEv)
    },
    hoverFu:function(){
    _.li.each(function(n){
    var th=$(this)
    $('a',th)
    .bind('mouseenter',function(){
    if(_.enable)
    if(_.hover&&n!=_.n)
    _.hvrin(th)
    })
    .bind('mouseleave',function(){
    if(_.enable)
    if(_.hover&&n!=_.n)
    _.hvrout(th)
    })
    })
    },
    hvrin:function(el){
    _.hoverIn(el,_)
    _.hover=='sprites'
    &&$('a',el).sprites('hoverin')
    },
    hvrout:function(el){
    _.hoverOut(el,_)
    _.hover=='sprites'
    &&$('a',el).sprites('hoverout')
    },
    hoverIn:function(){},
    hoverOut:function(){},
    defFunc:function(){}
    }

    data?_=data:th.data({navigs:_=$.extend({},_)})
    typeof o=='object'&&$.extend(_,o)

    if(typeof o=='function')
    return th.bind(_.changeEv,function(){o(_.param,_);return false}).trigger(_.changeEv)

    _.me||_.init(_.me=th)

    typeof o=='number'&&_.chngFu(o)
    //typeof o=='boolean'&&(_.enable=o)
    typeof o=='string'&&(o=='prev'||o=='next'||o=='close'||o= ='back'?_[o+'Fu']():_.useHash?o.slice(0,3)=='#!/'&&(location.hash=o)||_.customStr(o):_.customStr(o ))
    })
    return this
    }

    })(jQuery)

  6. #6

    re

    ...nessuno che mi può aiutare?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.