0

因此,我使用 SVG 点和 raphael.js 创建了一个地图。

可以在这里查看http://laithazzam.com/work/helpmeplz/

我正在尝试根据单击的土地块将新内容加载到页面中。

动态完成此任务的最有效方法是什么?每个 SVG 路径都有一个在 path.js 文件中定义的名称和 url,理想情况下,我希望单击以提取 id,并将其应用于 .html,

例如

单击区域 1,它将 area1.html 中的内容加载到此文档中的特定 div 中。

**我确实有一个点击功能工作

.click(function(){
        location.href = paths[arr[this.id]].url;

       $(".video-js").animate({
                opacity: 1
            }, 1000);
            $( "#map" ).animate({
                opacity: 0
                }, 2000, function() {
         $( "#map" ).css({ 
            "top" : "-610px",
            "opacity" : "1" 
         });
         $( "#map_btn" ).animate({
             opacity: "1",
             zIndex: "25"
         });
      }); 

        $( "#map_close_btn" ).animate({
                opacity: "0",
                zIndex: "20"
                },500); 
            })
        }
    });

我觉得在这里,我应该能够提取 id,并将其插入

$( "#content" ).load( "area1.html");

但是我将如何根据点击动态输入“area1.html”?

非常感谢,如果您需要我的其他任何东西,请告诉我!

4

0 回答 0