Pages

Monday, October 21, 2013

Return to top in page using jquery

$("html, body").animate({ scrollTop: 0 }, 200);
 
use this jquery code in onclick event. it's working like a charm. This 
is the simplest code for return to top in page. It is also working if 
you are using AJAX and calling from AJAX part.
 
If it's help you, comment it and share it.
 
 
 

Tuesday, October 15, 2013

migx inside migx in Modx Revo

Here i am showing code for migx within another migx in Modx Revolution

BackEnd :
first you have to written below code in "Form tabs" when you create migx TV in which you want to show another migx,

{"field":"institutions","caption":"Institutions","inputTV":"another_migx_name","renderer":"this.renderChunk"},

this will create another migx inside your original migx and store values in it.

FrontEnd :
now in frontend in main migx write simple migx code for fetch values from main migx.
[[!getImageList?
           &tvname='migxTVname`
           &tpl=`mainChunkName`
]]

in another migx for fetching values you can write like this code,
[[!getImageList?
        &value=`[[+institutions]]`
        &tpl=`Chunk_name`
]]

now it's done, and it will show your inside migx values.

If this helps you comment it and share it.

Friday, October 4, 2013

jQuery not working after AJAX call


When programmer bounded the functionality of the click event even before the new content is injected to the DOM. So that functionality will not be available to the newly added (injected) dynamic content. To handle this , you need to use jQuery on

So Change your code from
$(function(){
   $(".class_name").click(function(){    
     // your code    
   });
});
to
$(function(){
    $(document).on("click",".class_name",function(){
       //your code
    });
});
jQuery on will work for current and future elements. on is avaialbe from jQuery 1.7+ onwards. If you are using a previous version of jQuery, use live

So Change code in previous version
$(".class_name").live("click",function(){