{"issue":{"milestone":null,"title":"Images with link","created_at":"2011-09-26T21:45:38Z","user":{"login":"RhapsodySolutions","id":1082049,"url":"https://api.github.com/users/RhapsodySolutions","gravatar_id":"693ceb93e1b4b3487b13ae71cb4ef7c6","avatar_url":"https://secure.gravatar.com/avatar/693ceb93e1b4b3487b13ae71cb4ef7c6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"updated_at":"2011-12-30T14:18:29Z","state":"closed","labels":[],"id":1746639,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":"2011-12-12T21:03:47Z","html_url":"https://github.com/ryrych/rcarousel/issues/4","body":"How to add links for image. I have tried to use the following in the source-- it removes the links.\r\n&lt;ul&gt;<br />\r\n&lt;li&gt;<br />\r\n&lt;a href=&quot;http://www.yourtowntv.com/video/330/c/1/lakewood-october-news&quot; &gt;<br />\r\n&lt;img src=&quot;http://img.youtube.com/vi/q1cug-02I64/2.jpg&quot; /&gt;<br />\r\n&lt;/a&gt;<br />\r\n&lt;/li&gt;<br />\r\n&lt;/ul&gt;\r\n\r\nIt does not work. Within the page, the link is gone.\r\n\r\nThanks.","number":4,"url":"https://api.github.com/repos/ryrych/rcarousel/issues/4","comments":16,"assignee":null},"comment":{"created_at":"2011-12-30T14:18:29Z","user":{"login":"evrim","id":357997,"url":"https://api.github.com/users/evrim","gravatar_id":"cdb9f4e386390e172139354f36761d74","avatar_url":"https://secure.gravatar.com/avatar/cdb9f4e386390e172139354f36761d74?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"updated_at":"2011-12-30T14:18:29Z","id":3313444,"body":"Hi!\r\n\r\nThanks for rcarousel, jcarousel & lite was not working for me, i'm now using your code. Preverving links is insufficient. I need to preserve also the onclick events.\r\n\r\nHere is your _addElement, modified:\r\n\r\n\r\n                _addElement: function( jQueryElement, direction ) {\r\n                        var $root = $( this.element ),\r\n                                $content = $root.find( \"div.wrapper\" ),\r\n                                options = this.options;\r\n\r\n                        jQueryElement\r\n                                .width( options.width )\r\n                                .height( options.height );\r\n\r\n                        if ( options.orientation === \"horizontal\" ) {\r\n                                $( jQueryElement ).css( \"marginRight\", options.margin );\r\n                        } else {\r\n                                $( jQueryElement ).css({\r\n                                        marginBottom: options.margin,\r\n                                        \"float\": \"none\"\r\n                                });\r\n                        }\r\n                        if ( direction === \"prev\" ) {\r\n                            var x = jQueryElement.clone()[0];\r\n                            var a1 = nodeSearch(function(a) {return a.tagName == \"A\";}, x);\r\n                            var a2 = nodeSearch(function(a) {return a.tagName == \"A\";}, jQueryElement[0]);\r\n                            mapcar2(function(a,b) { a.onclick = b.onclick; }, a1, a2);\r\n                            $content.prepend( x );\r\n                        } else {\r\n                            var x = jQueryElement.clone()[0];\r\n                            var a1 = nodeSearch(function(a) {return a.tagName == \"A\";}, x);\r\n                            var a2 = nodeSearch(function(a) {return a.tagName == \"A\";}, jQueryElement[0]);\r\n                            mapcar2(function(a,b) { a.onclick = b.onclick; }, a1, a2);\r\n                            $content.append(x);\r\n                        }\r\n                },\r\n\r\n\r\nnodeSearch searches domTree bfs or dfs, mapcar2 is map with two lists. you can refer to sources at www.coretal.net/library.core\r\n\r\nevrim.\r\n","url":"https://api.github.com/repos/ryrych/rcarousel/issues/comments/3313444"},"action":"created"}