Solved

problem with jquery dom.

Posted on 2014-10-16
5
16 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 41
jQuery value within div undefined 3 20
safari scroll causing z-index div to bounce 1 13
gif animation 6 17
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…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
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)

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now