Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Parallax element and custom code
New Landing › How can we help? › Themeforest Theme Support › Dante › Parallax element and custom code
- This topic has 8 replies, 2 voices, and was last updated 10 years by Kyle – SUPPORT.
-
Posted in: Dante
-
January 14, 2015 at 8:15 pm #141560
hi
i have a parallax element which works fine – below the text i now need to place
this code
<script>
(function() {
var randomId = Math.floor(Math.random() * 100000);
var targetElemId = ‘bcom_rwidget_’ + randomId;
document.write(‘<div id=”‘ + targetElemId + ‘”></div>’);
var script = document.createElement(‘script’);
script.type = ‘text/javascript’;
script.async = true;
script.src = ‘http://www.booking.com/review_widget/at/hoteloberhofertelfes.de.html?tmpl=review_widget/review_widget&wid=’ + targetElemId + ‘&wtype=box_small&hotel_id=70267&widget_language=de’;
var node = document.getElementsByTagName(‘script’)[0];
node.parentNode.insertBefore(script, node);
}());
</script>but as soon as i copy the code in the text box i can not save the parallax element and wordpress automatically changes the code…
any ideas or workarounds for this problem?
thank you!
January 15, 2015 at 9:08 am #141628Hi
Add a Row asset for your parallax background, then add a text box inside for your text, then below that add a Raw JS asset and paste the above code
– Kyle
January 15, 2015 at 10:15 am #141641hi kyle,
thank you for your response – i have tried it, but its still not showing up on the website. here is the code:
[spb_column width=”1/2″ el_position=”first”] [spb_text_block pb_margin_bottom=”no” pb_border_bottom=”no” width=”1/1″ el_position=”first last”]
<h1 style=”text-align: left;”><span style=”background-color: #000000;”>Willkommen im Hotel Oberhofer.
Das kleine Hotel mit der großen Küche
Zentral im Stubaital gelegen.</span></h1>
<div style=”text-align: left;”>[sf_button colour=”black” type=”standard” size=”standard” link=”http://www.tiscover.com/at/xlayout/accs/53123at,de,SCH1/objectId,ACC291268at,curr,EUR,on,ACC9168at/avail.html?ffs=3″ target=”_blank” icon=”” dropshadow=”no” extraclass=””]Preise & Buchen[/sf_button][sf_modal header=”Anfrage senden” btn_colour=”black” btn_type=”standard” btn_size=”standard” btn_text=”Anfragen”][contact-form-7 id="49" title="anfrage-deutsch"][/sf_modal][sf_button colour=”pink” type=”standard” size=”standard” link=”http://www.tiscover.com/at/xlayout/portal/accommodation/53123at,de,SCH1/objectId,ACC291268at,folder,HDP_CACHE,season,at1,selectedEntry,hdplist/hdplist.html?ffs=3″ target=”_blank” icon=”” dropshadow=”no” extraclass=””]Packages[/sf_button]</div>
[/spb_text_block]
[spb_raw_js width=”1/1″ el_position=”first last”]
<script>
(function() {
var randomId = Math.floor(Math.random() * 100000);
var targetElemId = ‘bcom_rwidget_’ + randomId;
document.write(‘<div id=”‘ + targetElemId + ‘”></div>’);
var script = document.createElement(‘script’);
script.type = ‘text/javascript’;
script.async = true;
script.src = ‘http://www.booking.com/review_widget/at/hoteloberhofertelfes.de.html?tmpl=review_widget/review_widget&wid=’ + targetElemId + ‘&wtype=box_small&hotel_id=70267&widget_language=de’;
var node = document.getElementsByTagName(‘script’)[0];
node.parentNode.insertBefore(script, node);
}());
</script>
[/spb_raw_js]
[/spb_column] [spb_column width=”1/2″ el_position=”last”]
<iframe src=”//www.youtube.com/embed/KDo9UdPzOvY?rel=0″ width=”400″ height=”225″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe>[/spb_column][/spb_parallax]
January 15, 2015 at 10:21 am #141644Please provide me with a link and login so I can try for you
– Kyle
January 15, 2015 at 11:03 am #141668This reply has been marked as private.January 16, 2015 at 11:01 am #141982You need to recreate your page, it’s a mess, not sure how you’ve managed it. You need to change out all Parallax assets for Row assets, like I said in my previous comment. So that you can add a Raw JS asset inside your Row.
Parallax assets only support text inside, where as with Rows you can drag any page builder asset inside it
– Kyle
January 16, 2015 at 2:19 pm #142043ok… the way i understand it now is that within parallax elements you can only have text?
January 16, 2015 at 2:23 pm #142046[spb_row parallax_video_height=”video-height” parallax_video_overlay=”none” parallax_image_height=”content-height” parallax_image_movement=”fixed” parallax_image_speed=”0.5″ row_overlay_opacity=”0″ width=”1/1″ el_position=”first last”] [spb_parallax parallax_type=”image” bg_image=”240″ bg_type=”cover” parallax_video_height=”video-height” parallax_video_overlay=”none” parallax_image_height=”window-height” parallax_image_movement=”fixed” parallax_image_speed=”0.5″ alt_background=”none” width=”1/1″ el_position=”first last”]
This is a parallax text block. Click the edit button to change this text.
[spb_raw_js width=”1/1″ el_position=”first last”]<script>
(function() {
var randomId = Math.floor(Math.random() * 100000);
var targetElemId = ‘bcom_rwidget_’ + randomId;
document.write(‘<div id=”‘ + targetElemId + ‘”></div>’);
var script = document.createElement(‘script’);
script.type = ‘text/javascript’;
script.async = true;
script.src = ‘http://www.booking.com/review_widget/at/habicht.de.html?tmpl=review_widget/review_widget&wid=’ + targetElemId + ‘&wtype=box_big&hotel_id=259923&widget_language=de’;
var node = document.getElementsByTagName(‘script’)[0];
node.parentNode.insertBefore(script, node);
}());
</script>[/spb_raw_js][/spb_parallax] [/spb_row]
i have tried this one and it is not working… the script code is only working in a raw html or raw js element which is not in the parallax element…
January 16, 2015 at 3:02 pm #142056When you click the ‘Layout’ button you will see ‘Row’. You need to use that
– Kyle
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.