Kayıtlar

2013 tarihine ait yayınlar gösteriliyor

Richfaces ListShuttle Javascript Manipulation by jQuery

Hi again, for people who are still using Rich Faces with version 3.3.x and having problems in manipulating ShuttleList component via javascript, i have a solution for you. But i have to warn you before that it is not the best solution around. So I have a scenario in which when user selects not interested option then we need to deselect other options from the selected list. You may think that you can do it in server side but what if you have a problem with reRender because it does not works! Then here is my solution for you. Some people who just doesn't want to go to server side for such problem would like it i think. function beforeListChange(compId) { var srcValues = jQuery(jQuery(document.getElementById(compId)) .find('.rich-shuttle-body').find('.rich-shuttle-internal-tab')[0]).find('tr'); var tarValues = jQuery(jQuery(document.getElementById(compId)) .find('.rich-shuttle-body').find('.rich-shuttle-i...

Adding images dynamically via jQuery and resizing according to the container

Hi, suppose that you have a web service which returns image url's and you need to load them dynamically into your page via javascript with the help of jQuery but image sizes can vary and you need to resize them according to the size of your container div but if the image is smaller than the container div then you need to leave them as they are. You tried to set img tags display style as inline but it didn't work. Then you are welcome here is the solution for this trouble: HTML <div id="containerDivId" width="580" height="380" /> Script var img = $('<img>'); img.attr('src', 'http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Rubber_duck.jpeg/512px-Rubber_duck.jpeg'); img.appendTo('#containerDivId'); if(img[0].width>580) img[0].width = 580; if(img[0].height>380) img[0].height = 380;