1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    25
    Vote Rating
    1
    MYlover is on a distinguished road

      0  

    Default Answered: Function to change the html style

    Answered: Function to change the html style


    Hi may i know how should i change the HTML style with the function
    for example (but this one will change the element only, I want to change the style for the <img>:

    Code:
    xtype: 'panel',
    listeners: onTabImage,
     items: [{
               html: '<div class="pop" align="center"><img style="max-width:100%; max-height:100%; z-index:1;" src="www.image.xxxx" /></div>'
     }]
    
    var onTabImage =
    [{
                            element: 'element',
                            event: 'tap',
                            fn: (function(e,node,options,eOpts) {
    
                                this.element.setStyle("max-height","50%");
                            })
    }];
    Thanks

  2. This should work:

    Code:
    var img_Items = Ext.DomQuery.select('div.pop img');     // get Array of images
    
    // iterate through array:
    Ext.Array.each(img_Items, function(image) {
        image.style.cssText = "max-height: 50%;"; 
        //image.className += "some_CSS_Class";     // alternative with adding a css class   
       
    });

  3. #2
    Sencha User
    Join Date
    May 2012
    Posts
    131
    Answers
    7
    Vote Rating
    6
    klaus777 is on a distinguished road

      0  

    Default


    Maybe this


    Code:
    var img_Items = Ext.DomQuery.select('div.pop img');
    img_Items.setStyle('max-height', '50%');

  4. #3
    Sencha User
    Join Date
    May 2013
    Posts
    25
    Vote Rating
    1
    MYlover is on a distinguished road

      0  

    Default


    Quote Originally Posted by klaus777 View Post
    Maybe this


    Code:
    var img_Items = Ext.DomQuery.select('div.pop img');
    img_Items.setStyle('max-height', '50%');
    Thanks but I get this error
    Object [object Array] has no method 'setStyle'

  5. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      1  

    Default


    Since the DomQuery is returning an array, you will need to supply an index to img_Items.

  6. #5
    Sencha User
    Join Date
    May 2012
    Posts
    131
    Answers
    7
    Vote Rating
    6
    klaus777 is on a distinguished road

      2  

    Default


    This should work:

    Code:
    var img_Items = Ext.DomQuery.select('div.pop img');     // get Array of images
    
    // iterate through array:
    Ext.Array.each(img_Items, function(image) {
        image.style.cssText = "max-height: 50%;"; 
        //image.className += "some_CSS_Class";     // alternative with adding a css class   
       
    });

  7. #6
    Sencha User
    Join Date
    May 2013
    Posts
    25
    Vote Rating
    1
    MYlover is on a distinguished road

      0  

    Default


    Thanks

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi