MediaWiki:Common.js: различия между версиями

Материал из Алговики
Перейти к навигации Перейти к поиску
(WebGL example)
(не показано 10 промежуточных версий 2 участников)
Строка 3: Строка 3:
 
(function () {
 
(function () {
  
  var myElement = document.getElementById('webgl-example');
+
$('head').append("<script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'> </script> <link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'></link>");
  myElement.innerHTML = '<script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'> </script> <link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'></link>';
+
 
 +
// $('#webgl-example').html("<x3d width='600px' height='400px'><scene><shape><box></box></shape></scene></x3d>");
 +
 
 +
$('#webgl-example').html("<x3d width='600px' height='400px'><scene><shape><appearance><material diffuseColor='1 0 0'></material></appearance><box></box></shape><transform translation='-3 0 0'><shape><appearance><material diffuseColor='0 1 0'></material></appearance><cone></cone></shape></transform><transform translation='3 0 0'><shape><appearance><material diffuseColor='0 0 1'></material></appearance><sphere></sphere></shape></transform></scene></x3d>");
 +
 
  
 
}());
 
}());

Версия 17:39, 15 июня 2018

/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */

(function () {

$('head').append("<script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'> </script> <link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'></link>");

// $('#webgl-example').html("<x3d width='600px' height='400px'><scene><shape><box></box></shape></scene></x3d>");

$('#webgl-example').html("<x3d width='600px' height='400px'><scene><shape><appearance><material diffuseColor='1 0 0'></material></appearance><box></box></shape><transform translation='-3 0 0'><shape><appearance><material diffuseColor='0 1 0'></material></appearance><cone></cone></shape></transform><transform translation='3 0 0'><shape><appearance><material diffuseColor='0 0 1'></material></appearance><sphere></sphere></shape></transform></scene></x3d>");


}());