Solved

problem with jquery dom.

Posted on 2014-10-16
5
32 Views
Last Modified: 2016-05-09
Hi guys.

Please have a look at the 2 links. The one "works" works like a champ. But "Fail" dosent work. Only difference is, that i load the content from javascript in the "fail" document.

I must be missing something, does anybody have a solution?


http://www.dandodesign.dk/test/fail.html
http://www.dandodesign.dk/test/works.html
0
Comment
Question by:bongii
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40384563
Both links work for me.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40384573
Oh I see what you mean, rearrange your js

$(function () {
 str = '<ul>' +
 		'<li><div class="red"></div></li>' +
		'<li><div class="blue"></div></li>' +
		'<li><div class="red"></div></li>' +
		'<li><div class="blue"></div></li>' +
		'<li><div class="red"></div></li>' +
		'<li><div class="blue"></div></li>' +
		'</ul>';
$(".RaptorContainer").html(str);
 
  $('.RaptorContainer').scrollbox({
	autoPlay: false,
    direction: 'h',
    distance: 134
  });
  $('#RaptorBackward').click(function () {
    $('.RaptorContainer').trigger('backward');
  });
  $('#RaptorForward').click(function () {
    $('.RaptorContainer').trigger('forward');
  });
 });

Open in new window

0
 

Author Comment

by:bongii
ID: 40384583
THANKS :)))
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question