Javascript Мультивыбор iframe src через select для DLE -news

			[xfgiven_player]
			 
					<iframe width="100%" height="315" src="[xfvalue_player]" frameborder="0" allowfullscreen style="display:block" scrolling="no" name="film_main" id="film_main"  ></iframe>
				 

   

<center>
<select id="select_i" name="select_items" size="1" onchange="javascript:urla=this.value;document.getElementById('film_main').src=urla;">
</select>
</center>

 
<script>
$(document).ready(function(){
  	

	/*
	var options = `https://video.sibnet.ru/shell.php?videoid=4074082|Серия 001
https://video.sibnet.ru/shell.php?videoid=4074008|Серия 002`;
   */
	var options = `[xfvalue_player]`;
 

	var count = (options.match(/\|/g) || []).length;
 	if (count>0) {
		options = options.replaceAll("\n", '</option><option value="');
		options = options.replaceAll("|",'">');
		$( '#select_i' ).html( '<option value="' + options + '</option>' );

		$('#select_i option:eq(0)').prop('selected', true);
		document.getElementById('film_main').src = $( "#select_i" ).val(); ;

	} else {
		$('#select_i').hide();	
	};




 
});
</script>
 
			[/xfgiven_player]

Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>